Teal cast on Flux 2 Klein 9B upscales

#4
by whatsthisaithing - opened

Howdy!

Been playing with this this morning. Just copy/pasting the subgraph into my various workflows. Works perfectly on Z Image Base and Turbo.

Tried it on Flux 2 Klein 9B (on my slightly tweaked distilled workflow and the stock base comfy template) and I'm getting a teal/green cast to the upscaled image. I've tried the linked pid model and a community member's version of the 2606 model. The 2606 is a little better, but still does it.

Here's what the linked original pid model (flux 2, 1024 -> 4096) looks like.

image

Any ideas what's going on? The upscale seems to work just fine, it's just the tint that's the issue.

Yeah, ditto. Was looking forward to a fixed Flux.2 version but it's still pretty dire.
It's nothing to do with Klein, by the way; it happens when I encode an image directly too. PiD doesn't really much care what the diffuser before it did, as it's replacing the autoencoder on the output side.

This is a 1:1 image that was generated at 1488^2, that I downscale to 1024^2. So it should be perfectly happy.

And yet:
image

Happens as well with the 512->2048 version too:
image

Compare with the Flux.1 1024->4096 version:
image

(The Flux.1 512->2048 also looked like crap, but I think that was just because I was downscaling a LOT so the source image was heavily degraded. Flux.1's autoencoder is 64 channels, versus Flux.2's 128, so there's just less room to infer from such a blurry input. At any rate, I don't hold that against PiD.)

I guess the obvious workaround is to decode and re-encode with Flux.1's VAE! 😅 From a technical standpoint it feels kinda cheaty but on a practical one... like, might as well, right?

Comfy Org org

Two things that can alleviate the color drift, when it's not extreme:

image

The bias was pretty predictable for the brightness/contrast so I made a node to automatically adjust it back, this was for the initial flux2 version so I'm not sure how well it works with the new one though.
And once close enough, simple color transfer should help as well, we have a node for that in ComfyUI core as well.

Using unsupported aspect ratio definitely makes it worse though (the model only goes up to 9:16 ), as well as using sigmas that deviate from their initial hardcoded schedule (the manual sigmas node that should be in at least my workflows).

Those definitely help a TON, thanks!

Still getting a strong green gradient cast at the bottom of 9:16 images (720x1280 starting resolution), but that's in Z and in Klein.

image

Doesn't happen in 1:1 or 16:9. Guessing that's just a model thing though. Ah well.

Two things that can alleviate the color drift, when it's not extreme:

image

The bias was pretty predictable for the brightness/contrast so I made a node to automatically adjust it back, this was for the initial flux2 version so I'm not sure how well it works with the new one though.
And once close enough, simple color transfer should help as well, we have a node for that in ComfyUI core as well.

Using unsupported aspect ratio definitely makes it worse though (the model only goes up to 9:16 ), as well as using sigmas that deviate from their initial hardcoded schedule (the manual sigmas node that should be in at least my workflows).

Manual sigmas did help, I should say; my results were the result of a bunch of fiddling and trying to get as close to best practices as possible (so 1:1, manual sigmas, fiddling with the prompt content and whatnot to get it consistent.) I'll try these nodes out though, thanks!

Sign up or log in to comment