comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
49.68k stars 5.23k forks source link

LCM crashing on cpu #1954

Closed BinaryQuantumSoul closed 9 months ago

BinaryQuantumSoul commented 9 months ago

I'm trying to run LCM on cpu only. I tried two times and both times it crashed without prior error/warning. I'm using StabilityMatrix and I have intel i5 gen 8.

Here's the workflow I used: image And here are the logs:

got prompt
input_blocks.1.0.skip_connection.weight down_blocks.0.resnets.0.conv_shortcut.weight
input_blocks.1.0.skip_connection.bias down_blocks.0.resnets.0.conv_shortcut.bias
input_blocks.2.0.skip_connection.weight down_blocks.0.resnets.1.conv_shortcut.weight
input_blocks.2.0.skip_connection.bias down_blocks.0.resnets.1.conv_shortcut.bias
input_blocks.5.0.skip_connection.weight down_blocks.1.resnets.1.conv_shortcut.weight
input_blocks.5.0.skip_connection.bias down_blocks.1.resnets.1.conv_shortcut.bias
input_blocks.8.0.skip_connection.weight down_blocks.2.resnets.1.conv_shortcut.weight
input_blocks.8.0.skip_connection.bias down_blocks.2.resnets.1.conv_shortcut.bias
input_blocks.10.0.skip_connection.weight down_blocks.3.resnets.0.conv_shortcut.weight
input_blocks.10.0.skip_connection.bias down_blocks.3.resnets.0.conv_shortcut.bias
input_blocks.11.0.skip_connection.weight down_blocks.3.resnets.1.conv_shortcut.weight
input_blocks.11.0.skip_connection.bias down_blocks.3.resnets.1.conv_shortcut.bias
input_blocks.12.0.op.weight down_blocks.3.downsamplers.0.conv.weight
input_blocks.12.0.op.bias down_blocks.3.downsamplers.0.conv.bias
middle_block.0.skip_connection.weight mid_block.resnets.0.conv_shortcut.weight
middle_block.0.skip_connection.bias mid_block.resnets.0.conv_shortcut.bias
middle_block.2.skip_connection.weight mid_block.resnets.1.conv_shortcut.weight
middle_block.2.skip_connection.bias mid_block.resnets.1.conv_shortcut.bias
output_blocks.11.2.conv.weight up_blocks.3.upsamplers.0.conv.weight
output_blocks.11.2.conv.bias up_blocks.3.upsamplers.0.conv.bias
label_emb.0.2.bias class_embedding.linear_2.bias
label_emb.0.0.bias class_embedding.linear_1.bias
label_emb.0.0.weight class_embedding.linear_1.weight
label_emb.0.2.weight add_embedding.linear_2.weight
label_emb.0.2.weight class_embedding.linear_2.weight
label_emb.0.2.bias add_embedding.linear_2.bias
label_emb.0.0.bias add_embedding.linear_1.bias
label_emb.0.0.weight add_embedding.linear_1.weight
model_type EPS
adm 0
left over keys in unet: dict_keys(['time_embedding.cond_proj.weight'])
model_type EPS
adm 0
Using split attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using split attention in VAE
missing {'cond_stage_model.clip_l.logit_scale', 'cond_stage_model.clip_l.text_projection'}
left over keys: dict_keys(['cond_stage_model.clip_l.transformer.text_model.embeddings.position_ids'])
Requested to load SD1ClipModel
Loading 1 new model
Requested to load BaseModel
Loading 1 new model
  0%|          | 0/5 [00:00<?, ?it/s]
Process finished with exit code 137
WinstonWoof commented 9 months ago

you're doing it wrong :)

You're using the LCM Dream shaper model which requires a specific sampler which is probably why its erroring as you're using a standard ksampler.

See https://github.com/0xbitches/ComfyUI-LCM

The easiest way to use LCM is the LCM Lora method, I have some example workflows on Civitai

https://civitai.com/models/138397/winstons-workflow-collection

Or take a look at Scott Detweilers (from Stable Diffusion) excellent video

https://www.youtube.com/watch?v=pw8eNpmhT5o

(or both)

image

BinaryQuantumSoul commented 9 months ago

Thanks. I changed sampler_name=lcm, steps=5, cfg=1.0 and it works.

Considering the LCM_Lora, would it load on cpu only ? Also, the generation is slowed down because I have to load normal dreamshaper to have clip and vae and also vae is very slow to decode