ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

Stable Cascade

Open DataCTE opened this issue 1 year ago • 101 comments
trafficstars

https://huggingface.co/stabilityai/stable-cascade image

DataCTE avatar Feb 13 '24 11:02 DataCTE

new stability model wondering if we could get native comfyui support for it

DataCTE avatar Feb 13 '24 11:02 DataCTE

I'm waiting for support too! Thanks

CyberTimon avatar Feb 13 '24 12:02 CyberTimon

It's inevitably gonna be supported, just be patient.

  • The whole point of ComfyUI is AI generation.
  • Stable Cascade is a major evolution which beats the crap out of SD1.5 and SDXL. It can now do hands, feet and text, and complicated prompts. Everyone wants it. You don't need to remind them. 😉
  • Stable Cascade even comes with a new Face ID transfer controlnet, which will generate high resolution faces with zero LoRA training.
  • It is also way more efficient, only taking something like 10% of the time to train a checkpoint or LoRA compared to SDXL. Which is gonna make a lot of people go crazy!
  • ComfyUI is Stability AI's internal, preferred UI for their developers and researchers.
  • In fact, comfyanonymous is working at Stability AI.
  • Stability even made Stable Swarm, a simpler UI for ComfyUI: https://github.com/Stability-AI/StableSwarmUI

It is obviously exciting enough that it will be supported soon.

Just be very patient. It takes a while to analyze the new architecture, creating new nodes, and figuring it all out. Let's not rush or demand anything! 😉

By the way, Stable Cascade isn't even finished yet. It's still in "early development" research/training. Their codebase is changing constantly. The large model currently uses 20 GB VRAM (!) and they think they can optimize this to 1/2 or 1/3 the usage when they are done. Furthermore, the diffusers library isn't even ready, and the code is far from reaching the quality needed for merging. So let's breathe.

Update: One of the Stability employees commented on Reddit that Comfy will have support in a week or two.

Arcitec avatar Feb 14 '24 00:02 Arcitec

Well. There's a basic node which doesn't implement anything and just uses the official code and wraps it in a ComfyUI node. No interesting support for anything special like controlnets, prompt conditioning or anything else really. It's just basic wrapper for some prompt strings and a seed. It doesn't support model loading or unloading, so it will hog your VRAM. I also see that it has a bug (loads one of the models as float16 instead of bfloat16). But hopefully still good enough for impatient people like @GaleBoro, while waiting.

https://github.com/kijai/ComfyUI-DiffusersStableCascade

Arcitec avatar Feb 14 '24 01:02 Arcitec

Alright. Here's another option to experiment with it locally in the meantime. It's Pinokio's tweak of the unofficial gradio web UI, and has removed the need for huggingface token / login.

Needs: Python 3.11. The two largest models need ~15.5 GB of VRAM at 1024x1024, or ~18.0-20.0 GB of VRAM on 1536x1536 with bfloat16 model format.

git clone https://huggingface.co/spaces/cocktailpeanut/stable-cascade pinokio
cd pinokio

python -m venv .venv
. .venv/bin/activate

pip install gradio spaces itsdangerous
pip install -r requirements.txt

python app.py

Arcitec avatar Feb 14 '24 10:02 Arcitec

Even with Comfy UI vram optimizations, it seems that unless you have a GPU that supports bfloat16 or has 16 GB vram, you can only use the "lite" version of the "Stage C" model, right ?

https://huggingface.co/stabilityai/stable-cascade/tree/main

edit:

Apparently, it could theoretically be possible to split the model for VRAM optimization.

https://news.ycombinator.com/item?id=39360106

The large C model have fair bit of parameters tied to text-conditioning, not to the main denoising process. Similar to how we split the network for SDXL Base, I am pretty confident we can split non-trivial amount of parameters to text-conditioning hence during denoising process, loading less than 3.6B parameters.

JorgeR81 avatar Feb 14 '24 16:02 JorgeR81

@JorgeR81 The CEO of Stability has made statements that SD1.0 originally used more than 20 GB VRAM too. And that they are confident that they can reduce Stable Cascade to 1/2 or 1/3 of the current VRAM requirements. He didn't go into detail what techniques they'd use to achieve that, but it sounds good to me, because the 20 GB VRAM usage right now is very painful.

Edit: The statements. Take them with a big grain of salt. But their hope is to reach 8 GB VRAM usage.

  • https://www.reddit.com/r/StableDiffusion/comments/1aprm4j/comment/kq9xsy5/
  • https://www.reddit.com/r/StableDiffusion/comments/1aprm4j/comment/kq94qj3/
  • https://www.reddit.com/r/StableDiffusion/comments/1aprm4j/comment/kq8qnj4/

Edit: And another statement that I found really interesting. Saying that RTX 40-series and newer cards will become increasingly required for future AI networks, because they support fp8 and optical flow:

  • https://www.reddit.com/r/StableDiffusion/comments/1ah06me/comment/konsqz1/

Arcitec avatar Feb 15 '24 01:02 Arcitec

I think it's worth waiting for the official release from comfyanonymous,

but there is the huggingface space, this colab from Camenduru (Gradio UI, runs on T4 - 80s for 1 image, slow): https://github.com/camenduru/stable-cascade-jupyter

& another one i put together on launch day (runs on A100 - 14 seconds for 4 images, fast): https://github.com/MushroomFleet/StableCascade-text2image

personally i can't wait to get this into Comfy, and there is a diffusers custom node here, if you can't wait! https://github.com/kijai/ComfyUI-DiffusersStableCascade

MushroomFleet avatar Feb 15 '24 18:02 MushroomFleet

It's implemented in the main repo now, you can use this workflow until I write an examples page for it.

https://gist.github.com/comfyanonymous/0f09119a342d0dd825bb2d99d19b781c

comfyanonymous avatar Feb 17 '24 06:02 comfyanonymous

stage、stage_b16、stage_lite、stage_lite_b16,Is there a big gap between them when it comes to generating images?

hben35096 avatar Feb 17 '24 07:02 hben35096

Error occurred when executing KSampler:

Given groups=1, weight of size [320, 16, 1, 1], expected input[2, 64, 12, 12] to have 16 channels, but got 64 channels instead

I get the following error, that's weird.

Edit: Solved! stage_c wasn't loaded properly.

Thireus avatar Feb 17 '24 10:02 Thireus

Is there any workflow example for img-to-img or controlnet?

hzhangxyz avatar Feb 17 '24 11:02 hzhangxyz

Getting an error when running the example workflow for Stable Cascade with both bf16 and lite models:

Error occurred when executing CLIPTextEncode:

output with shape [20, 77, 77] doesn't match the broadcast shape [1, 20, 77, 77]

File "/media/scratch/StableDiffusion/ComfyUI/execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/StableDiffusion/ComfyUI/execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/StableDiffusion/ComfyUI/execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/StableDiffusion/ComfyUI/nodes.py", line 56, in encode
cond, pooled = clip.encode_from_tokens(tokens, return_pooled=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/StableDiffusion/ComfyUI/comfy/sd.py", line 131, in encode_from_tokens
cond, pooled = self.cond_stage_model.encode_token_weights(tokens)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/StableDiffusion/ComfyUI/comfy/sd1_clip.py", line 514, in encode_token_weights
out, pooled = getattr(self, self.clip).encode_token_weights(token_weight_pairs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/StableDiffusion/ComfyUI/comfy/sd1_clip.py", line 39, in encode_token_weights
out, pooled = self.encode(to_encode)
^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/StableDiffusion/ComfyUI/comfy/sd1_clip.py", line 190, in encode
return self(tokens)
^^^^^^^^^^^^
File "/media/scratch/Python-envs/ComfyUI/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/Python-envs/ComfyUI/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/StableDiffusion/ComfyUI/comfy/sd1_clip.py", line 172, in forward
outputs = self.transformer(tokens, attention_mask, intermediate_output=self.layer_idx, final_layer_norm_intermediate=self.layer_norm_hidden_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/Python-envs/ComfyUI/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/Python-envs/ComfyUI/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/StableDiffusion/ComfyUI/comfy/clip_model.py", line 131, in forward
return self.text_model(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/Python-envs/ComfyUI/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/Python-envs/ComfyUI/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/StableDiffusion/ComfyUI/comfy/clip_model.py", line 109, in forward
x, i = self.encoder(x, mask=mask, intermediate_output=intermediate_output)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/Python-envs/ComfyUI/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/Python-envs/ComfyUI/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/StableDiffusion/ComfyUI/comfy/clip_model.py", line 68, in forward
x = l(x, mask, optimized_attention)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/Python-envs/ComfyUI/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/Python-envs/ComfyUI/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/StableDiffusion/ComfyUI/comfy/clip_model.py", line 49, in forward
x += self.self_attn(self.layer_norm1(x), mask, optimized_attention)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/Python-envs/ComfyUI/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/Python-envs/ComfyUI/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/StableDiffusion/ComfyUI/comfy/clip_model.py", line 20, in forward
out = optimized_attention(q, k, v, self.heads, mask)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/media/scratch/StableDiffusion/ComfyUI/comfy/ldm/modules/attention.py", line 117, in attention_basic
sim += mask
** ComfyUI startup time: 2024-02-17 12:52:52.409368
** Platform: Linux
** Python version: 3.11.5 (main, Sep 11 2023, 13:54:46) [GCC 11.2.0]
** Python executable: /media/scratch/Python-envs/ComfyUI/bin/python

### ComfyUI Revision: 1983 [805c36ac] | Released on '2024-02-17'

Torch version: 2.2.0+rocm5.7

Might be a problem on my end since I am running on AMD ROCm but wanted to leave this here if it crops up anywhere else.

Setting the clip type in "Load CLIP" to stable_diffusion instead of stable_cascade runs the workflow but results in random outputs.

Th3Rom3 avatar Feb 17 '24 11:02 Th3Rom3

Guys, sorry, where to get a proper CLIP G SDXL BF16?

ke1ne avatar Feb 17 '24 12:02 ke1ne

Guys, sorry, where to get a proper CLIP G SDXL BF16?

and this: https://huggingface.co/stabilityai/stable-cascade/blob/main/text_encoder/model.safetensors goes in the ComfyUI/models/clip/ folder to be loaded with the Load CLIP node in the workflow

Rename "model.safetensors" to "clip_g_sdxl.fp16.safetensors" or simply select "model.safetensors".

HelloClyde avatar Feb 17 '24 12:02 HelloClyde

stage、stage_b16、stage_lite、stage_lite_b16,Is there a big gap between them when it comes to generating images?

I'm using the full size models, but it's worth trying the [stage_c_lite] as well, since the results are very different, like a different model.

The bf16 models look the same, as the regular models.

The full size models are usable even on a GTX 1070 (8GB). Generation time is 125 sec, with the full size models ( "loading in lowvram mode 4717.692307472229") Generating for the first time is 165 sec ( loading the full models from SATA SSD ) With [stage_c_lite] is 55 and 65 sec respectively.

stage_c ( default workflow settings )

ComfyUI_00004_

stage_c_lite ( same seed )

ComfyUI_00009_

stage_c_lite ( better seed )

ComfyUI_00015_

JorgeR81 avatar Feb 17 '24 12:02 JorgeR81

Guys, sorry, where to get a proper CLIP G SDXL BF16?

and this: https://huggingface.co/stabilityai/stable-cascade/blob/main/text_encoder/model.safetensors goes in the ComfyUI/models/clip/ folder to be loaded with the Load CLIP node in the workflow

Rename "model.safetensors" to "clip_g_sdxl.fp16.safetensors" or simply select "model.safetensors".

Thank you!

ke1ne avatar Feb 17 '24 12:02 ke1ne

https://github.com/comfyanonymous/ComfyUI/issues/2785#issuecomment-1949967415

This should be fixed now.

comfyanonymous avatar Feb 17 '24 12:02 comfyanonymous

#2785 (comment)

This should be fixed now.

### ComfyUI Revision: 1984 [6c875d84] | Released on '2024-02-17'

Thanks for the insanely fast turnaround. Works like a charm now.

Th3Rom3 avatar Feb 17 '24 13:02 Th3Rom3

PixPin_2024-02-17_21-27-33 In terms of picture details, there is still room for improvement. Occasionally, there are prompts that cause a messy picture like the picture in the upper right corner.

hben35096 avatar Feb 17 '24 14:02 hben35096

The [stage c] steps can be reduced from 20 to 10, at least with my simple test prompt, for a generation time of 84 sec. The [stage_b] steps can be reduced from 10 to 5, with only a slight loss in skin texture quality, for a generation time of 67 sec. So this is faster than the 72 sec, I need for SDXL, ( for 20 steps ) for good image quality, on a GTX 1070.

stage_c ( 10 steps ) ( same seed as the first image in the post above )

ComfyUI_00033_

stage_c ( 10 steps ) stage_b ( 5 steps )

ComfyUI_00036_5

JorgeR81 avatar Feb 17 '24 14:02 JorgeR81

In terms of picture details, there is still room for improvement.

Yes, I also noticed that skin detail is not as good as the latest SDXL community finetunes, but I'm sure this will be improved.

In the huggingface model card it's stated one of the "Limitations" as "Faces and people in general may not be generated properly", so this is already much better than what I was expecting. 

The only downside is that a single set of cascade models at full size is 20 GB !

JorgeR81 avatar Feb 17 '24 15:02 JorgeR81

on amd directml mode and cpu mode i get the error Error occurred when executing UNETLoader:

unet_dtype() got an unexpected keyword argument 'supported_dtypes'

File "E:\AI\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "E:\AI\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "E:\AI\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "E:\AI\ComfyUI\nodes.py", line 850, in load_unet model = comfy.sd.load_unet(unet_path) File "E:\AI\ComfyUI\comfy\sd.py", line 553, in load_unet model = load_unet_state_dict(sd) File "E:\AI\ComfyUI\comfy\sd.py", line 540, in load_unet_state_dict unet_dtype = model_management.unet_dtype(model_params=parameters, supported_dtypes=model_config.supported_inference_dtypes)

CraftMaster163 avatar Feb 17 '24 16:02 CraftMaster163

ah it was some of my custom nodes, idk which one(s) tho lol

CraftMaster163 avatar Feb 17 '24 16:02 CraftMaster163

@CraftMaster163 Did you update Comfy? This issue is supposedly fixed with a recent commit (to this specified custom node).

Edit: Seems like I indeed misread the issue I mentioned. Looks like beyond main Comfy any modules replacing the affected modules will have to be updated, too.

Th3Rom3 avatar Feb 17 '24 16:02 Th3Rom3

i updated my comfyui. got to update nodes too tho

CraftMaster163 avatar Feb 17 '24 16:02 CraftMaster163

When we start getting stable cascade models from the community, I'm going to run out of space very fast, on my main drive.

But, by editing the [ extra_model_paths.yaml ], I was able to load the models in the "unet" folder, from another drive in my PC. You can still keep models in the main "unet" folder; they will also be accessible in the UI. And this can also be done for "checkpoints", "loras", etc., ...

https://github.com/comfyanonymous/ComfyUI/blob/master/extra_model_paths.yaml.example

Instructions are in this discussion: https://github.com/comfyanonymous/ComfyUI/discussions/72 You need to rename the file to [ extra_model_paths.yaml ] Inside the file you need to change the base path, according to the folder you created for your extra models.

The only new step is to add the "unet" folder to the example provided, like this: Here I also keep paths for other large model types, but you don't need to create the folders, if you're not using them.

comfyui:
      base_path: d:/ComfyUI/
      
      checkpoints: models/checkpoints/
      clip_vision: models/clip_vision/
      controlnet: models/controlnet/
      loras: models/loras/
      unet: models/unet/
      upscale_models: models/upscale_models/
      vae: models/vae/

If it works you should see extras lines in the cmd line, for each new path, when opening Comfy UI, like this:

"Adding extra search path unet d:/ComfyUI/models/unet/"

JorgeR81 avatar Feb 17 '24 17:02 JorgeR81

#2785 (comment)

This should be fixed now.

SDXL is broken now for some reason. Stable Cascade is working.

Error occurred when executing CLIPTextEncode:

shape '[77, -1, 77, 77]' is invalid for input of size 5929

  File "/Users/tom/ComfyUI/execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "/Users/tom/ComfyUI/execution.py", line 82, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "/Users/tom/ComfyUI/execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "/Users/tom/ComfyUI/nodes.py", line 56, in encode
    cond, pooled = clip.encode_from_tokens(tokens, return_pooled=True)
  File "/Users/tom/ComfyUI/comfy/sd.py", line 131, in encode_from_tokens
    cond, pooled = self.cond_stage_model.encode_token_weights(tokens)
  File "/Users/tom/ComfyUI/comfy/sdxl_clip.py", line 54, in encode_token_weights
    g_out, g_pooled = self.clip_g.encode_token_weights(token_weight_pairs_g)
  File "/Users/tom/ComfyUI/comfy/sd1_clip.py", line 39, in encode_token_weights
    out, pooled = self.encode(to_encode)
  File "/Users/tom/ComfyUI/comfy/sd1_clip.py", line 190, in encode
    return self(tokens)
  File "/Users/tom/ComfyUI/venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/Users/tom/ComfyUI/venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/Users/tom/ComfyUI/comfy/sd1_clip.py", line 172, in forward
    outputs = self.transformer(tokens, attention_mask, intermediate_output=self.layer_idx, final_layer_norm_intermediate=self.layer_norm_hidden_state)
  File "/Users/tom/ComfyUI/venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/Users/tom/ComfyUI/venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/Users/tom/ComfyUI/comfy/clip_model.py", line 131, in forward
    return self.text_model(*args, **kwargs)
  File "/Users/tom/ComfyUI/venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/Users/tom/ComfyUI/venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/Users/tom/ComfyUI/comfy/clip_model.py", line 109, in forward
    x, i = self.encoder(x, mask=mask, intermediate_output=intermediate_output)
  File "/Users/tom/ComfyUI/venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/Users/tom/ComfyUI/venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/Users/tom/ComfyUI/comfy/clip_model.py", line 68, in forward
    x = l(x, mask, optimized_attention)
  File "/Users/tom/ComfyUI/venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/Users/tom/ComfyUI/venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/Users/tom/ComfyUI/comfy/clip_model.py", line 49, in forward
    x += self.self_attn(self.layer_norm1(x), mask, optimized_attention)
  File "/Users/tom/ComfyUI/venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/Users/tom/ComfyUI/venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/Users/tom/ComfyUI/comfy/clip_model.py", line 20, in forward
    out = optimized_attention(q, k, v, self.heads, mask)
  File "/Users/tom/ComfyUI/comfy/ldm/modules/attention.py", line 117, in attention_basic
    mask = mask.reshape(mask.shape[0], -1, mask.shape[-2], mask.shape[-1]).expand(-1, heads, -1, -1).reshape(sim.shape)

lalalabush avatar Feb 17 '24 18:02 lalalabush

PixPin_2024-02-17_21-27-33 In terms of picture details, there is still room for improvement. Occasionally, there are prompts that cause a messy picture like the picture in the upper right corner.

I also get some pictures like the top right corner one from time to time.

Thireus avatar Feb 17 '24 18:02 Thireus

Got error when enabling fp8 mode:

Error occurred when executing KSampler:

Promotion for Float8 Types is not supported, attempted to promote Float8_e4m3fn and BFloat16

  File "D:\workspace\ComfyUI\execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "D:\workspace\ComfyUI\execution.py", line 82, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "D:\workspace\ComfyUI\execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "D:\workspace\ComfyUI\nodes.py", line 1380, in sample
    return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
  File "D:\workspace\ComfyUI\nodes.py", line 1350, in common_ksampler
    samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
  File "D:\workspace\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 22, in informative_sample
    raise e
  File "D:\workspace\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 9, in informative_sample
    return original_sample(*args, **kwargs)  # This code helps interpret error messages that occur within exceptions but does not have any impact on other operations.
  File "D:\workspace\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved\animatediff\sampling.py", line 248, in motion_sample
    return orig_comfy_sample(model, noise, *args, **kwargs)
  File "D:\workspace\ComfyUI\comfy\sample.py", line 100, in sample
    samples = sampler.sample(noise, positive_copy, negative_copy, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed)
  File "D:\workspace\ComfyUI\custom_nodes\ComfyUI_smZNodes\__init__.py", line 130, in KSampler_sample
    return _KSampler_sample(*args, **kwargs)
  File "D:\workspace\ComfyUI\comfy\samplers.py", line 713, in sample
    return sample(self.model, noise, positive, negative, cfg, self.device, sampler, sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
  File "D:\workspace\ComfyUI\custom_nodes\ComfyUI_smZNodes\__init__.py", line 149, in sample
    return _sample(*args, **kwargs)
  File "D:\workspace\ComfyUI\comfy\samplers.py", line 618, in sample
    samples = sampler.sample(model_wrap, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
  File "D:\workspace\ComfyUI\comfy\samplers.py", line 557, in sample
    samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **self.extra_options)
  File "C:\Users\SLAPaper\scoop\apps\miniconda3\current\envs\sd_webui\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "D:\workspace\ComfyUI\comfy\k_diffusion\sampling.py", line 154, in sample_euler_ancestral
    denoised = model(x, sigmas[i] * s_in, **extra_args)
  File "C:\Users\SLAPaper\scoop\apps\miniconda3\current\envs\sd_webui\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\Users\SLAPaper\scoop\apps\miniconda3\current\envs\sd_webui\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
  File "D:\workspace\ComfyUI\comfy\samplers.py", line 281, in forward
    out = self.inner_model(x, sigma, cond=cond, uncond=uncond, cond_scale=cond_scale, model_options=model_options, seed=seed)
  File "C:\Users\SLAPaper\scoop\apps\miniconda3\current\envs\sd_webui\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\Users\SLAPaper\scoop\apps\miniconda3\current\envs\sd_webui\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
  File "D:\workspace\ComfyUI\comfy\samplers.py", line 271, in forward
    return self.apply_model(*args, **kwargs)
  File "D:\workspace\ComfyUI\custom_nodes\ComfyUI_smZNodes\smZNodes.py", line 1047, in apply_model
    out = super().apply_model(*args, **kwargs)
  File "D:\workspace\ComfyUI\comfy\samplers.py", line 268, in apply_model
    out = sampling_function(self.inner_model, x, timestep, uncond, cond, cond_scale, model_options=model_options, seed=seed)
  File "D:\workspace\ComfyUI\comfy\samplers.py", line 248, in sampling_function
    cond_pred, uncond_pred = calc_cond_uncond_batch(model, cond, uncond_, x, timestep, model_options)
  File "D:\workspace\ComfyUI\comfy\samplers.py", line 222, in calc_cond_uncond_batch
    output = model.apply_model(input_x, timestep_, **c).chunk(batch_chunks)
  File "D:\workspace\ComfyUI\comfy\model_base.py", line 91, in apply_model
    model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float()
  File "C:\Users\SLAPaper\scoop\apps\miniconda3\current\envs\sd_webui\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\Users\SLAPaper\scoop\apps\miniconda3\current\envs\sd_webui\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
  File "D:\workspace\ComfyUI\comfy\ldm\cascade\stage_c.py", line 263, in forward
    level_outputs = self._down_encode(x, r_embed, clip, cnet)
  File "D:\workspace\ComfyUI\comfy\ldm\cascade\stage_c.py", line 201, in _down_encode
    x = block(x)
  File "C:\Users\SLAPaper\scoop\apps\miniconda3\current\envs\sd_webui\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\Users\SLAPaper\scoop\apps\miniconda3\current\envs\sd_webui\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
  File "D:\workspace\ComfyUI\comfy\ldm\cascade\common.py", line 109, in forward
    x = self.channelwise(x.permute(0, 2, 3, 1)).permute(0, 3, 1, 2)
  File "C:\Users\SLAPaper\scoop\apps\miniconda3\current\envs\sd_webui\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\Users\SLAPaper\scoop\apps\miniconda3\current\envs\sd_webui\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\Users\SLAPaper\scoop\apps\miniconda3\current\envs\sd_webui\lib\site-packages\torch\nn\modules\container.py", line 217, in forward
    input = module(input)
  File "C:\Users\SLAPaper\scoop\apps\miniconda3\current\envs\sd_webui\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\Users\SLAPaper\scoop\apps\miniconda3\current\envs\sd_webui\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
  File "D:\workspace\ComfyUI\comfy\ldm\cascade\common.py", line 87, in forward
    return self.gamma.to(x.device) * (x * Nx) + self.beta.to(x.device) + x

SLAPaper avatar Feb 17 '24 18:02 SLAPaper