Flux: callback to decode intermediate images #9394
Replies: 4 comments 2 replies
-
Cc: @asomoza |
Beta Was this translation helpful? Give feedback.
-
Probably better to be answered by @TimothyAlexisVass, but the explanation is in the same part that you linked:
I haven't really looked at it, but Flux uses a 16ch VAE right? It won't be as easy to do the same trick with it. The Flux generations are so slow though, that using the teaf1 won't make it noticeable slower. |
Beta Was this translation helpful? Give feedback.
-
Here are the experiments I did I started out with trying to use the conversion formula for YCbCr to RGB which I then tried to adapt to the unique color space of SDXL. I then continued with a different approach, trying to get the best result until I realized that you can't get a perfect result and then just settled on some "good enough" numbers. |
Beta Was this translation helpful? Give feedback.
-
Actually, I remember that I saw that comfyui had a file for some models, I found that it has the ones for Flux, so probably you can use those values but you'll need to adapt the preview function for them. This is probably your answer. |
Beta Was this translation helpful? Give feedback.
-
In this doc there is a callback snippet allowing to display the intermediate images, for SDXL inferences, as 128*128 images.
This comes in handy eg to follow the denoising process.
For FLUX, I was able to display the intermediate images (in the output image's resolution, so not as 128*128 images) by decoding the latents inside the inference code (specifically the dunder call of the FluxPipeline), at each step. I subclassed
FluxPipeline
and that did the trick well.This question is maybe for @asomoza because he is mentioned as the contributor in the doc:
could you please explain the snippet given in the article referenced by the doc above (copied below):
This will hopefully help me adapt this to FLUX.
In particular how you came up with the values used like the weights and biases.
thank you
cc @sayakpaul @TimothyAlexisVass
Beta Was this translation helpful? Give feedback.
All reactions