Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VAE problem? #1840

Closed
E2GO opened this issue Jan 9, 2024 · 10 comments · Fixed by #2867
Closed

VAE problem? #1840

E2GO opened this issue Jan 9, 2024 · 10 comments · Fixed by #2867
Labels
enhancement New feature or request question Further information is requested
Milestone

Comments

@E2GO
Copy link

E2GO commented Jan 9, 2024

Is there a way to check VAE usage while inpainting in Fooocus? Or may be it's not even VAE but upscaler\inpaint issue. Strange question may be, but I see that images after inpainting or upscaling became more unsaturated and kind of bleached.
Some additional info: all settings used the same as on generation while upscaling, 1 custom LORA used. Don't have such problem with A1111.
Heavy images below!
Original:
image
Upscaled with 2x:
image
image
Problem not only for this generations - here is just an example.
UPD: fast 2x upscale work ok.

@E2GO
Copy link
Author

E2GO commented Jan 9, 2024

Also checkout inpainting bleach. Here I turned custom LORA to 0 just to check out if it's affecting results or not.
Unmasked content:
image

Masked content:
image

Result - it's visible that masked zone is desaturated and bleached. Also there's kind of other parts of the image a little bleached too. So that's why I think there's some VAE problem:
image

@mashb1t
Copy link
Collaborator

mashb1t commented Jan 9, 2024

Are you by chance using the "Extreme Speed" preset? Might have to do with that, it is prone to grey /wash out content..
If not, please make sure the issue still exists when opening a new tab of Fooocus (browser session debugging) and provide a link to the the LoRA you're using + your preset/config.

Inpainting with LoRA (realistic default one) works fine, all default configs:
image - 2024-01-09T210547 035

@mashb1t mashb1t added the question Further information is requested label Jan 9, 2024
@E2GO
Copy link
Author

E2GO commented Jan 9, 2024

It's surely not Extreme Speed - double checked it.

  1. Completely restarted UI - loaded settings from log, upscale 2x - gives again bleached results.
  2. Did another one experiment with default Juggernaut model, made new generations, no LORA's used - all works fine. Before I've used MOHAWK_v20 model and custom made own LORA.

Can I somehow choose vae for not default one Jug model? May be mohawk checkpoint don't have embedded one and it tries to use VAE somehow not suitable for it?... Just a thoughts - don't know how much it clever, sry))) Because usually I got such behavior (on sd1.5 especially) when VAE is not "right" one..

@E2GO
Copy link
Author

E2GO commented Jan 9, 2024

Prompt is rather simple:
{
"Prompt": "highly detailed mutant head and face\npostapocalyptic giant mutant, solo, mighty eerie look, army style, wuart style character creature concept",
"Negative Prompt": "deviantart, (hands:1.3), jpeg, child painting",
"Fooocus V2 Expansion": "highly detailed mutant head and face, glowing, sharp focus, highly intricate, cinematic light, clear, crisp, very coherent, symmetry, artistic, innocent, beautiful, novel, romantic, stunning, enhanced, color, epic, best, fine, fair, perfect, colorful, vivid, inspired, creative, complex, professional, amazing, gorgeous, attractive, full, awesome",
"Styles": "['Fooocus V2']",
"Performance": "Quality",
"Resolution": "(1024, 1024)",
"Sharpness": 2,
"Guidance Scale": 4,
"ADM Guidance": "(1.5, 0.8, 0.3)",
"Base Model": "MOHAWK_v20.safetensors",
"Refiner Model": "None",
"Refiner Switch": 0.5,
"Sampler": "dpmpp_2m_sde_gpu",
"Scheduler": "karras",
"Seed": 8200128622392930234,
"LoRA 1": "sd_xl_offset_example-lora_1.0.safetensors : 0.1",
"LoRA 2": "Weapon_Wu_Conceptart_EGGOXL_v3.safetensors : 0.0",
"Version": "v2.1.862"
}

Can private share a LORA by DM to you @mashb1t - it's custom one in-home not for using worldwide. But still - it was switched to zero when I'm using upscale.

@lllyasviel
Copy link
Owner

hi some XL model author like those grey feeling and they use grey color vae baked in their models

so it is intentional by those XL model authors. and this is not related to us

Fooocus does not do anything to make it look grey. Also we make sure that all default settings/models do not have this problem.

@mashb1t
Copy link
Collaborator

mashb1t commented Jan 9, 2024

some XL model author like those grey feeling and they use grey color vae baked in their models

Thank you @lllyasviel for your insights. I only knew about the noise offset for more black images (https://civitai.com/models/10391?modelVersionId=12354), but a grey offset might be used in this case.

@E2GO you can check if MOHAWK_v20.safetensors includes this or if your LoRA is based on another LoRA with this offset. If your LoRA was trained on the SDXL base model you can basically use it with every other SDXL model, so feel free to mix and match.

Closing this issue for now, feel free to let us know your findings!

@mashb1t mashb1t closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2024
@E2GO
Copy link
Author

E2GO commented Jan 9, 2024

@lllyasviel @mashb1t Thanks for info! Will check mohawk model for sure about it. May be will try experiment with removing and adding other one vae))
FYI: My LORA extracted from finetuned model based on sd_xl_base_1.0_0.9vae checkpoint.

@E2GO
Copy link
Author

E2GO commented Jan 10, 2024

Well, it's definitely VAE problem. I've baked sdxl vae into model and get those results (upscale 2x):
image

@mashb1t @lllyasviel Sorry for interrupting you, but I don't think it's the only one such model, so can I have a suggestion on implement some kind of selection of VAE used for model? Such as A1111 have function to choose which VAE to use - it can be automatic (used baked one or if it's not bakes - default) or forces (just choosing which one to use).
From A1111: image

@mashb1t mashb1t mentioned this issue May 4, 2024
3 tasks
@mashb1t mashb1t reopened this May 4, 2024
@mashb1t
Copy link
Collaborator

mashb1t commented May 4, 2024

VAE select has been implemented, please check out #2867

@mashb1t mashb1t added the enhancement New feature or request label May 4, 2024
@mashb1t mashb1t added this to the 2.4.0 milestone May 4, 2024
@mashb1t
Copy link
Collaborator

mashb1t commented May 9, 2024

merged to develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants