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

Flux support #36

Open
alex-mitov opened this issue Aug 24, 2024 · 17 comments
Open

Flux support #36

alex-mitov opened this issue Aug 24, 2024 · 17 comments
Labels
enhancement New feature or request

Comments

@alex-mitov
Copy link

Hello,

I've been using the Tiled Diffusion node in ComfyUI with really good results. I was wondering if there are any plans to support the new Flux model by Black Forest Labs.

Thanks in advance!

@Adreitz
Copy link

Adreitz commented Aug 26, 2024

Not the dev, but have you confirmed that it does not work? I haven't tried it yet with Flux dev, but I had tried it with SD3. It seemed to work, but failed when I introduced the SD3 tile controlnet (it applied the whole initial image to each tile, rather than just the corresponding portion of the initial image). Since there is no Flux tile controlnet yet to my knowledge, and Flux seems to hallucinate very little when naively tiling anyway, this might not be a big problem.

@alex-mitov
Copy link
Author

I meant to say that the problem happens with the tile controlnet. Sorry for not being clear. Just like you described, it applies the initial image to each tile. :(

There already is a tile control net for Flux as part of the Union controlnet model by Instant X.

@Adreitz
Copy link

Adreitz commented Aug 26, 2024

Thanks for the quick confirmation! While getting the node working correctly with tile is important in the long run, I'd recommend trying it without the controlnet with Flux. Up to now I've just been using Ultimate SD Upscale node with Flux with barely any hallucinations or tile discontinuities (mostly in very smooth backgrounds where one tile might not have any detail to speak of, so Flux might introduce speckles or posterization in the gradations in the second pass), so hopefully it will work well with this node, too.

Example with no controlnets:
ComfyUI_00013_
ComfyUI_00014_

@alex-mitov
Copy link
Author

Thanks for the quick confirmation! While getting the node working correctly with tile is important in the long run, I'd recommend trying it without the controlnet with Flux. Up to now I've just been using Ultimate SD Upscale node with Flux with barely any hallucinations or tile discontinuities (mostly in very smooth backgrounds where one tile might not have any detail to speak of, so Flux might introduce speckles or posterization in the gradations in the second pass), so hopefully it will work well with this node, too.

Example with no controlnets:

Looks good! Have you been able to creatively resample or/and upscale with Flux? I'm getting much more creative results when resampling/upscaling images with SD 1.5 models and the SD 1.5 tile controlnet.

@Adreitz
Copy link

Adreitz commented Aug 26, 2024

I haven't tried. My personal opinion is that the creative aspect should happen at the initial low-res generation, where the quality will be the best, and that upscaling should simply be a matter of increasing the image detail with as few compositional changes as possible. Flux is working pretty well for me in that regard, but it means I don't really have experience with other ways of working.

@shiimizu shiimizu added the enhancement New feature or request label Sep 2, 2024
@Vigilence
Copy link

This node doesn't support the GGUF version but does the fp8 version. I look forward to the gguf version being supported in the future.

@shiimizu
Copy link
Owner

shiimizu commented Sep 3, 2024

Flux fp & gguf should be okay now.

@alex-mitov
Copy link
Author

alex-mitov commented Sep 3, 2024

Hi, @shiimizu . I was very excited to try the new update to Tiled Diffusion, but it still doesn't work for me. I'm still getting the same image in each tile. Am I doing something wrong? Please see the screenshot below..

I tried both Flux FP16 and Flux FP8, and I also tried Multi Diffusion in both Mixture of Diffusers and MultiDiffusion modes. My ComfyUI is updated to the latest version - 2639 [b643ea] (2024-09-01).

tiled_diffusion_flux_not_working

@Vigilence
Copy link

Does anyone have a working workflow for flux? I keep getting:

The size of tensor a (4) must match the size of tensor b (2) at non-singleton dimension 0

@alex-mitov
Copy link
Author

Does anyone have a working workflow for flux? I keep getting:

The size of tensor a (4) must match the size of tensor b (2) at non-singleton dimension 0

Make sure the widths and heights of your latents and images are always divisible by 16. Flux doesn't like dimensions that are not divisible by 16 and will often give errors if you don't follow this rule.

@shiimizu
Copy link
Owner

shiimizu commented Sep 4, 2024

@alex-mitov Instantx/union flux controlnets aren't working at the moment. I'll try to fix it. The other depth & canny ones work fine though.

@Vigilence
Copy link

Does anyone have a working workflow for flux? I keep getting:
The size of tensor a (4) must match the size of tensor b (2) at non-singleton dimension 0

Make sure the widths and heights of your latents and images are always divisible by 16. Flux doesn't like dimensions that are not divisible by 16 and will often give errors if you don't follow this rule.

I just checked and they are divisible by 16.

shiimizu added a commit that referenced this issue Sep 5, 2024
@shiimizu
Copy link
Owner

shiimizu commented Sep 5, 2024

FLUX Union ControlNets should work now.

@Vigilence Is that related to TiledDiffusion? If so, open a new issue with a workflow and full error stacktrace.

@alex-mitov
Copy link
Author

I can confirm that Tiled Diffusion now works as expected with Flux!

@hakbodi
Copy link

hakbodi commented Sep 13, 2024

I can confirm that Tiled Diffusion now works as expected with Flux!

Can you share a workflow for that please?

@alex-mitov
Copy link
Author

I can confirm that Tiled Diffusion now works as expected with Flux!

Can you share a workflow for that please?

Just connect the Tiled Diffusion node to the "model" input of your Ksampler. Nothing complicated. :)

@uzitotte
Copy link

I also need a workflow for this..

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

No branches or pull requests

6 participants