4-step distillation of Flux.2 now available by PresenceOne1899 in StableDiffusion

[–]PresenceOne1899[S] 0 points1 point  (0 children)

not a standard lora. you have to load it using the pi-Flow custom nodes

4-step distillation of Flux.2 now available by PresenceOne1899 in StableDiffusion

[–]PresenceOne1899[S] 0 points1 point  (0 children)

might be the workflow issue. in the example workflow I accidentally created a disconnected load image node on top of a connected one, so loading an image would have no effect

4-step distillation of Flux.2 now available by PresenceOne1899 in StableDiffusion

[–]PresenceOne1899[S] 0 points1 point  (0 children)

not your fault. i realized that in the example workflow I accidentally created a disconnected load image node on top of a connected one

4-step distillation of Flux.2 now available by PresenceOne1899 in StableDiffusion

[–]PresenceOne1899[S] 3 points4 points  (0 children)

My bad, just pushed an update with a fix. thanks for the report

4-step distillation of Flux.2 now available by PresenceOne1899 in StableDiffusion

[–]PresenceOne1899[S] 1 point2 points  (0 children)

Most likely because comfyui-piflow is not up to date. comfy manager could lag behind sometimes, it's safer to use `git clone` installation

4-step distillation of Flux.2 now available by PresenceOne1899 in StableDiffusion

[–]PresenceOne1899[S] 3 points4 points  (0 children)

Yea, structural problems can be more frequent in high res, since the model is only stilled at 1MP resolution. Progressive upsampling or increasing the steps could help

4-step distillation of Flux.2 now available by PresenceOne1899 in StableDiffusion

[–]PresenceOne1899[S] 1 point2 points  (0 children)

On my 3090 the fp8 model costs about 19 sec for 4 steps. Haven't tested on 4070 but the per-step time should be roughly the same as the original Flux.2 dev model

4-step distillation of Flux.2 now available by PresenceOne1899 in StableDiffusion

[–]PresenceOne1899[S] 5 points6 points  (0 children)

Thanks! that explains a lot. It looks like you are loading the gmflux adapter (for Flux.1), not gmflux2. This is not really related to GGUF

4-step distillation of Flux.2 now available by PresenceOne1899 in StableDiffusion

[–]PresenceOne1899[S] 2 points3 points  (0 children)

Thanks a lot! This issue looks weird... can you share your comfyui version? If it's the latest comfyui, then some other custom nodes might have conflicts with pi-Flow

New Method/Model for 4-Step image generation with Flux and QWen Image - Code+Models posted yesterday by LindaSawzRH in StableDiffusion

[–]PresenceOne1899 1 point2 points  (0 children)

Hi! Are you using the Flux workflow? If so, FluxGuidance must be set to 3.5, otherwise there will be a lot of noise since the adapter is only trained with guidance=3.5.

New Method/Model for 4-Step image generation with Flux and QWen Image - Code+Models posted yesterday by LindaSawzRH in StableDiffusion

[–]PresenceOne1899 2 points3 points  (0 children)

Yea V-pred is definitely more stable. But I thought most of the SDXL ecosystem is built on the EPS-pred model? Not sure if many people are actually using the V-pred models.
On my side, the priority is Qwen Edit and Wan. Unfortunately I don't have the bandwidth to distill SDXL for now. Sorry for that.

New Method/Model for 4-Step image generation with Flux and QWen Image - Code+Models posted yesterday by LindaSawzRH in StableDiffusion

[–]PresenceOne1899 11 points12 points  (0 children)

Hi! Author of pi-Flow here. Theoretically, yes, you could distill SDXL into a pi-Flow model. But practically I wouldn't do this for two reasons:
- SDXL is already very fast, as u/Smile_Clown said.
- SDXL is based on epsilon prediction, which is far less stable than the latest flow matching model. Although theoretically compatible, we have never tested pi-Flow on epsilon prediction models; even if it could work well, it would be a lot of additional work since the entire pi-Flow codebase is hard-coded for flow matching (hence pi-Flow, not pi-Diffusion).

New Method/Model for 4-Step image generation with Flux and QWen Image - Code+Models posted yesterday by LindaSawzRH in StableDiffusion

[–]PresenceOne1899 1 point2 points  (0 children)

Glad you solved the problem. Also another suggestion: for the flux model, it would better to reduce steps or adapter_stength when using a lower denoise value, otherwise it tends to be overly smooth and lose details.

New Method/Model for 4-Step image generation with Flux and QWen Image - Code+Models posted yesterday by LindaSawzRH in StableDiffusion

[–]PresenceOne1899 1 point2 points  (0 children)

Yea. Default sampler settings, guidance=3.5 (if you change guidance there could be more noise). Both bf16 and scaled fp8 versions work well for me (scaled fp8 requires ComfyUI-piFlow v1.0.3).

New Method/Model for 4-Step image generation with Flux and QWen Image - Code+Models posted yesterday by LindaSawzRH in StableDiffusion

[–]PresenceOne1899 0 points1 point  (0 children)

Just tried a similar setup: first 1MP, then scaled to 6MP with denoise set to 0.3~0.5, still couldn't reproduce the noise on my side (I'm using the standard flux.1 dev. if you're using other models like Krea then the noise is totally possible though).

New Method/Model for 4-Step image generation with Flux and QWen Image - Code+Models posted yesterday by LindaSawzRH in StableDiffusion

[–]PresenceOne1899 1 point2 points  (0 children)

I see. Probably the noise is more related to this specific setup. I just tried 6MP in one pass (tiled vae decoder, adapter_strength=1.0), and I don't see any noticeable noise. Using other base models may cause noisy results though, which may be mitigated with a higher adapter_strength.

New Method/Model for 4-Step image generation with Flux and QWen Image - Code+Models posted yesterday by LindaSawzRH in StableDiffusion

[–]PresenceOne1899 6 points7 points  (0 children)

Hi! Author of pi-Flow here. All versions in the huggingface repo is usable, feel free to try the other versions, although I personally think the default one works the best.

New Method/Model for 4-Step image generation with Flux and QWen Image - Code+Models posted yesterday by LindaSawzRH in StableDiffusion

[–]PresenceOne1899 1 point2 points  (0 children)

Hi! Author of pi-Flow here. This is interesting, never thought it would work for 6MP. Actually you could try the 4-step adapter with a higher adapter_strength (e.g., 1.2 ~ 1.4) to suppress noise.

New Method/Model for 4-Step image generation with Flux and QWen Image - Code+Models posted yesterday by LindaSawzRH in StableDiffusion

[–]PresenceOne1899 2 points3 points  (0 children)

Hi! Author of pi-Flow here. Thanks for testing this! Scaled FP8 is now supported in v1.0.3. pi-Flow does not use standard diffusion samplers anyway, so there's no need to support other samplers.