Fooocus icon indicating copy to clipboard operation
Fooocus copied to clipboard

[Feature Request]: I hope to replace the LCM model with the PCM model because it has a more friendly effect.

Open HelloLaohe opened this issue 1 year ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What would your feature do?

My modifications were carried out as follows:

Phased Consistency Model: https://huggingface.co/wangfuyun/PCM_Weights

Step 1: Download the 8-step model of the Phased Consistency Model(pcm_sdxl_normalcfg_8step_converted.safetensors), then rename it to "sdxl_lcm_lora.safetensors" and replace the file in the loras directory.

Step 2: Modify the Fooocus\modules\async_worker.py file as follows: sampler_name = "dpmpp_2m_sde" scheduler_name = "exponential" They suggested using ddim, but after testing, dpmpp_2m_sde is more suitable for Fooocus.

Step 3: Save and restart. After restarting, select: Extreme Speed, enable LCM (PCM).

The support effect of juggernautXL_v8Rundiffusion.safetensors and juggernautXL_v9Rundiffusionphoto2.safetensors is very good, while the image quality of juggernautXL_juggernautX.safetensors is not high.

2024-06-04_19-17-06_2241 2024-06-04_19-16-09_1682 2024-06-04_19-15-31_1826

Proposed workflow

[Fooocus] Downloading LCM components ... [Parameters] Adaptive CFG = 1.0 [Parameters] CLIP Skip = 2 [Parameters] Sharpness = 0.0 [Parameters] ControlNet Softness = 0.25 [Parameters] ADM Scale = 1.0 : 1.0 : 0.0 [Parameters] CFG = 2.0 [Parameters] Seed = 1141405151197866064 [Parameters] Sampler = dpmpp_2m_sde - exponential [Parameters] Steps = 8 - 8 [Fooocus] Initializing ... [Fooocus] Loading models ...

Additional information

No response

HelloLaohe avatar Jun 04 '24 11:06 HelloLaohe

I downloaded pcm_sdxl_normalcfg_16step_converted.safetensors, and also modified the flags.py file to increase the number of steps.

` class Steps(IntEnum): QUALITY = 60 SPEED = 30 EXTREME_SPEED = 16 LIGHTNING = 8 HYPER_SD = 4

class StepsUOV(IntEnum): QUALITY = 42 SPEED = 18 EXTREME_SPEED = 16 LIGHTNING = 8 HYPER_SD = 4 ` 2024-06-04_19-50-31_9759 2024-06-04_19-49-58_6131 2024-06-04_19-51-54_2506

HelloLaohe avatar Jun 04 '24 11:06 HelloLaohe

Poll has been started, please find it at https://github.com/lllyasviel/Fooocus/discussions/3094

mashb1t avatar Jun 04 '24 20:06 mashb1t

Smart

nrrm1 avatar Jun 05 '24 22:06 nrrm1