Skip to content

Instantly share code, notes, and snippets.

@comfyanonymous
Last active April 4, 2024 11:23
Show Gist options
  • Save comfyanonymous/0f09119a342d0dd825bb2d99d19b781c to your computer and use it in GitHub Desktop.
Save comfyanonymous/0f09119a342d0dd825bb2d99d19b781c to your computer and use it in GitHub Desktop.
Stable Cascade Workflow
{
"last_node_id": 40,
"last_link_id": 112,
"nodes": [
{
"id": 34,
"type": "StableCascade_EmptyLatentImage",
"pos": [
205,
705
],
"size": {
"0": 315,
"1": 150
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "stage_c",
"type": "LATENT",
"links": [
82
],
"shape": 3,
"slot_index": 0
},
{
"name": "stage_b",
"type": "LATENT",
"links": [
83
],
"shape": 3,
"slot_index": 1
}
],
"properties": {
"Node name for S&R": "StableCascade_EmptyLatentImage"
},
"widgets_values": [
1024,
1024,
42,
1
]
},
{
"id": 30,
"type": "UNETLoader",
"pos": [
-240,
288
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
76
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "UNETLoader"
},
"widgets_values": [
"stage_c.safetensors"
]
},
{
"id": 37,
"type": "CLIPLoader",
"pos": [
-240,
384
],
"size": {
"0": 315,
"1": 82
},
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "CLIP",
"type": "CLIP",
"links": [
93,
94
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPLoader"
},
"widgets_values": [
"clip_g_sdxl.fp16.safetensors",
"stable_cascade"
]
},
{
"id": 29,
"type": "VAELoader",
"pos": [
1272,
569
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 3,
"mode": 0,
"outputs": [
{
"name": "VAE",
"type": "VAE",
"links": [
68
],
"shape": 3
}
],
"properties": {
"Node name for S&R": "VAELoader"
},
"widgets_values": [
"stage_a.safetensors"
]
},
{
"id": 8,
"type": "VAEDecode",
"pos": [
1621,
267
],
"size": {
"0": 210,
"1": 46
},
"flags": {},
"order": 10,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 98
},
{
"name": "vae",
"type": "VAE",
"link": 68,
"slot_index": 1
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
9
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 9,
"type": "SaveImage",
"pos": [
1864,
269
],
"size": {
"0": 935.7432250976562,
"1": 1006.83154296875
},
"flags": {},
"order": 11,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 9
}
],
"properties": {},
"widgets_values": [
"wuer/ComfyUI"
]
},
{
"id": 32,
"type": "UNETLoader",
"pos": [
-240,
192
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 4,
"mode": 0,
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
84
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "UNETLoader"
},
"widgets_values": [
"stage_b.safetensors"
]
},
{
"id": 3,
"type": "KSampler",
"pos": [
616,
315
],
"size": {
"0": 315,
"1": 262
},
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 76,
"slot_index": 0
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 107
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 108
},
{
"name": "latent_image",
"type": "LATENT",
"link": 82
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
88
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
431329770300382,
"randomize",
20,
4,
"euler_ancestral",
"simple",
1
]
},
{
"id": 33,
"type": "KSampler",
"pos": [
1278,
265
],
"size": {
"0": 315,
"1": 262
},
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 84,
"slot_index": 0
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 86
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 112
},
{
"name": "latent_image",
"type": "LATENT",
"link": 83
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
98
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
242719335273011,
"randomize",
10,
1.1,
"euler_ancestral",
"simple",
1
]
},
{
"id": 6,
"type": "CLIPTextEncode",
"pos": [
96,
288
],
"size": {
"0": 422.84503173828125,
"1": 164.31304931640625
},
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 93
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
107,
111
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"beautiful scenery nature glass bottle landscape, , purple galaxy bottle,"
]
},
{
"id": 7,
"type": "CLIPTextEncode",
"pos": [
96,
480
],
"size": {
"0": 425.27801513671875,
"1": 180.6060791015625
},
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 94
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
108,
112
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
""
]
},
{
"id": 36,
"type": "StableCascade_StageB_Conditioning",
"pos": [
955,
274
],
"size": {
"0": 277.20001220703125,
"1": 46
},
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"name": "conditioning",
"type": "CONDITIONING",
"link": 111
},
{
"name": "stage_c",
"type": "LATENT",
"link": 88
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
86
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "StableCascade_StageB_Conditioning"
}
}
],
"links": [
[
9,
8,
0,
9,
0,
"IMAGE"
],
[
68,
29,
0,
8,
1,
"VAE"
],
[
76,
30,
0,
3,
0,
"MODEL"
],
[
82,
34,
0,
3,
3,
"LATENT"
],
[
83,
34,
1,
33,
3,
"LATENT"
],
[
84,
32,
0,
33,
0,
"MODEL"
],
[
86,
36,
0,
33,
1,
"CONDITIONING"
],
[
88,
3,
0,
36,
1,
"LATENT"
],
[
93,
37,
0,
6,
0,
"CLIP"
],
[
94,
37,
0,
7,
0,
"CLIP"
],
[
98,
33,
0,
8,
0,
"LATENT"
],
[
107,
6,
0,
3,
1,
"CONDITIONING"
],
[
108,
7,
0,
3,
2,
"CONDITIONING"
],
[
111,
6,
0,
36,
0,
"CONDITIONING"
],
[
112,
7,
0,
33,
2,
"CONDITIONING"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}
@halr9000
Copy link

Save time on finding and placing models in the correct locations by using the ComfyUI Manager model feature. Someone has uploaded them all:

image

@exo-pla-net
Copy link

Bug in these instructions:

stable_cascade_workflow_test.json:
search for: "clip_g_sdxl.fp16.safetensors"
change to: "model.safetensors"

Further instructions for noobs to get Stable Cascade to work:

  • Download and extract ComfyUI.
  • Download the suggested models and place in the suggested directories.
  • Put the "stable_cascade_workflow_test.json" file anywhere.
  • Fix its bug that I described above.
  • Open ComfyUI using "run_nvidia_gpu.bat".
  • Click "Load" and load in the stable_cascade_workflow_test.json.
  • Click "Queue prompt". ComfyUI will do its thing, and a generated bottle should appear.
  • This whole business is currently fiddly as hell, but from here you should be able to tinker your way into some good images.
  • Hint: the commas in the bottle prompt do mysterious but important things. I'd tell you if I myself understood it.

@ssimpson91
Copy link

Bug in these instructions:

stable_cascade_workflow_test.json: search for: "clip_g_sdxl.fp16.safetensors" change to: "model.safetensors"

Further instructions for noobs to get Stable Cascade to work:

  • Download and extract ComfyUI.
  • Download the suggested models and place in the suggested directories.
  • Put the "stable_cascade_workflow_test.json" file anywhere.
  • Fix its bug that I described above.
  • Open ComfyUI using "run_nvidia_gpu.bat".
  • Click "Load" and load in the stable_cascade_workflow_test.json.
  • Click "Queue prompt". ComfyUI will do its thing, and a generated bottle should appear.
  • This whole business is currently fiddly as hell, but from here you should be able to tinker your way into some good images.
  • Hint: the commas in the bottle prompt do mysterious but important things. I'd tell you if I myself understood it.

thanks a lot!

@halr9000
Copy link

Note that OP posted this gist initially as a prototype, and a lot has changed since then. Your best path is going to be to start from his Stable Cascade examples. You'll notice that Stability AI released models with CLIP embedded, and other changes result in a simplified workflow.

@ronaldomirandah
Copy link

Can you help me please? My comfyui dont find these missing nodes:
EmptyLatent and Conditioning.
Searching doesnt return any results. Is there way to manually install this? Can find it. Thanks a lot in advance!

@lord-lethris
Copy link

lord-lethris commented Feb 28, 2024

I downloaded the models to the required folders as specified above.
And it started to download:

model.safetensors
diffusion_pytorch_model.safetensors

where did it download these? as I already have them in another directory - and they are quite large to have "doubled up"

image

EDIT:
No matter, currently not supporting ML (there is a surprise - not blaming this community or its dev's btw)

Loading pipeline components...:   0%|                                | 0/6 [00:00<?, ?it/s]The config attributes {'c_in': 16} were passed to StableCascadeUnet, but are not expected and will be ignored. Please verify your config.json configuration file.
Loading pipeline components...: 100%|████████████████████████| 6/6 [00:01<00:00,  3.82it/s]
[F D:\a\_work\1\s\pytorch-directml-plugin\torch_directml\csrc\engine\dml_util.cc:118] Invalid or unsupported data type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment