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

Awful Flux Fill results. (blurry, grainy results) #5746

Closed
JackDainzh opened this issue Nov 23, 2024 · 13 comments
Closed

Awful Flux Fill results. (blurry, grainy results) #5746

JackDainzh opened this issue Nov 23, 2024 · 13 comments
Labels
Potential Bug User is reporting a bug. This should be tested.

Comments

@JackDainzh
Copy link

JackDainzh commented Nov 23, 2024

Expected Behavior

tmptkjjhagi

A proper image being generated without the said artifact (blurry, grainy). Like on the image above when generating on Replicate Space.

Actual Behavior

Generates images with awful, mushy quality.
ComfyUI_00086_
ComfyUI_00088_

Steps to Reproduce

Use a standard (recommended) workflow for flux fill. You can load either a standard 22 gb dev model, or use a GGUF one, the results are nearly the same.

Debug Logs

no errors during and after generation.

Other

Have encountered another person on CivitAI using an community made FP8 version of this model, who describes that the results are exactly the same as I am encountering.

@JackDainzh JackDainzh added the Potential Bug User is reporting a bug. This should be tested. label Nov 23, 2024
@yincangshiwei
Copy link

It seems that not all GPUs are compatible, and there may be issues under certain seeds, only a few specific seeds are normal.
#5715

@yincangshiwei
Copy link

It should be related to this:
black-forest-labs/flux#195

@JackDainzh
Copy link
Author

JackDainzh commented Nov 24, 2024

It should be related to this: black-forest-labs/flux#195

Strange, I have RTX 4070 gpu, should work fine I think? Because 4070 has Ada Lovelace architecture, which should work as expected.

@Mozer
Copy link

Mozer commented Nov 24, 2024

I have 2080ti-22GB and flux fill outpaint works bad (grainy) with high resolutions of the final image (more than 700x700). With lower res (632x696) it looks almost OK but still not perfect. With my 3060-12GB it works perfect. I tried fp16, fp8 and gguf_q4_0 checkpoints. Clip is fp8. Inpaint also suffers when high res.
I tried with fp16 checkpoint in default mode - same bad results.

Python version: 3.11.9
pytorch version: 2.5.1+cu121
comfyUI v0.3.4
ComfyUI_01592 - ComfyUI - Google Chrome 24 11 2024 11_46_50
ComfyUI_01592 - ComfyUI - Google Chrome 24 11 2024 11_51_35

@taiyouZhang
Copy link

me too, always wierd blurry

@catbaba777
Copy link

I tried many times, depending on the resolution and expanding the area of ​​the image. Same goes for partial repaints. Noise appears when large areas are redrawn. Simple compositions and lower raw images are easier to achieve good results at 768 or 512 resolution. Additionally, it relies on random seeds. In short, very uncontrollable. .

@Mozer
Copy link

Mozer commented Nov 25, 2024

I have successfully used Flux fill 1024x1024 20 steps on my 2080ti-22GB using this diffusers-bnb-nf4 code https://huggingface.co/sayakpaul/FLUX.1-Fill-dev-nf4
No noise on the sides that i have with comfy. But nf4 quality in the center is degraded a bit, compared to fp8 version that i have on my 3060. Inpaint and outpaint works. Inpaint looks better. uses 16 GB of vram. Original flux dev in diffusers version is needed to run this code.

python 3.11.10, cuda 11.8, torch: 2.5.1+cu118
output_FLUX_1-Fill-dev-nf4_4bit
output_FLUX_1-Fill-dev-nf4_4bit_11

@willhsmit
Copy link

Buried in a Swarmui commit
mcmonkeyprojects/SwarmUI@d83fe84

is the comment:

  • Boosting the Flux Guidance Scale way up to eg 30 may improve quality

I can confirm that making this change is a substantial improvement for me on a few test generations.

@JackDainzh
Copy link
Author

All these generations that are shown in my examples were made with Guidance of 30.

@willhsmit
Copy link

Are you inpainting or outpainting? I ask because normally I expect a flux fill output to contain a mix of content leftover from the original image and generated content, and yours look uniformly mushy everywhere.

@JackDainzh
Copy link
Author

JackDainzh commented Nov 26, 2024

That was inpainting with the whole image masked, to show the issue more clearly. As for generating with small patches, it's the same, new generated objects are mushy too

@comfyanonymous
Copy link
Owner

Should be fixed now. The flux inpaint model does not work in fp16 unlike the other flux models. The fix is to make it inference in fp32 on cards that do not support bf16 which is slow but will make it work.

@Mozer
Copy link

Mozer commented Nov 26, 2024

Thx, I can confirm it is working for my 2080ti now, though slower.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Potential Bug User is reporting a bug. This should be tested.
Projects
None yet
Development

No branches or pull requests

7 participants