ComfyUI-TiledDiffusion icon indicating copy to clipboard operation
ComfyUI-TiledDiffusion copied to clipboard

Flux support

Open alex-mitov opened this issue 1 year ago • 18 comments

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!

alex-mitov avatar Aug 24 '24 23:08 alex-mitov

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.

Adreitz avatar Aug 26 '24 03:08 Adreitz

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.

alex-mitov avatar Aug 26 '24 03:08 alex-mitov

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_

Adreitz avatar Aug 26 '24 04:08 Adreitz

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.

alex-mitov avatar Aug 26 '24 15:08 alex-mitov

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.

Adreitz avatar Aug 26 '24 15:08 Adreitz

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.

Vigilence avatar Sep 03 '24 03:09 Vigilence

Flux fp & gguf should be okay now.

shiimizu avatar Sep 03 '24 09:09 shiimizu

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

alex-mitov avatar Sep 03 '24 15:09 alex-mitov

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

Vigilence avatar Sep 03 '24 17:09 Vigilence

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.

alex-mitov avatar Sep 03 '24 18:09 alex-mitov

@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.

shiimizu avatar Sep 04 '24 11:09 shiimizu

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.

Vigilence avatar Sep 04 '24 15:09 Vigilence

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.

shiimizu avatar Sep 05 '24 01:09 shiimizu

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

alex-mitov avatar Sep 05 '24 02:09 alex-mitov

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

Can you share a workflow for that please?

hakbodi avatar Sep 13 '24 23:09 hakbodi

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. :)

alex-mitov avatar Sep 14 '24 14:09 alex-mitov

I also need a workflow for this..

dolphin-electric avatar Sep 21 '24 08:09 dolphin-electric

@alex-mitov @shiimizu

I'm having trouble getting Tiled Diffusion upscaling to work with Flux dev and Union ControlNet. When setting it up similarly to SD1.5 or SDXL, the results look very strange.

Could you provide an example workflow that works with this setup?

Here’s my current workflow: Pastebin Link

Example result:

Image

JPGranizo avatar Feb 28 '25 02:02 JPGranizo