Skip to content

Instantly share code, notes, and snippets.

@comfyanonymous
Last active May 30, 2024 05:30
Show Gist options
  • Save comfyanonymous/fcce4ced378f74f4c46026b134faf27a to your computer and use it in GitHub Desktop.
Save comfyanonymous/fcce4ced378f74f4c46026b134faf27a to your computer and use it in GitHub Desktop.
DMD2 SDXL 4 step workflow.
{
"last_node_id": 12,
"last_link_id": 12,
"nodes": [
{
"id": 8,
"type": "VAEDecode",
"pos": [
1209,
188
],
"size": {
"0": 210,
"1": 46
},
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 7
},
{
"name": "vae",
"type": "VAE",
"link": 8
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
12
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 5,
"type": "EmptyLatentImage",
"pos": [
473,
609
],
"size": {
"0": 315,
"1": 106
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
2
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "EmptyLatentImage"
},
"widgets_values": [
1024,
1024,
1
]
},
{
"id": 7,
"type": "CLIPTextEncode",
"pos": [
413,
389
],
"size": {
"0": 425.27801513671875,
"1": 180.6060791015625
},
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 5
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
6
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
""
]
},
{
"id": 10,
"type": "UNETLoader",
"pos": [
38,
76
],
"size": {
"0": 315,
"1": 58
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
10
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "UNETLoader"
},
"widgets_values": [
"DMD2_sdxl_pytorch_model.bin"
]
},
{
"id": 4,
"type": "CheckpointLoaderSimple",
"pos": [
35,
188
],
"size": {
"0": 315,
"1": 98
},
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [],
"slot_index": 0
},
{
"name": "CLIP",
"type": "CLIP",
"links": [
3,
5
],
"slot_index": 1
},
{
"name": "VAE",
"type": "VAE",
"links": [
8
],
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": [
"sd_xl_base_1.0.safetensors"
]
},
{
"id": 3,
"type": "KSampler",
"pos": [
865,
187
],
"size": {
"0": 315,
"1": 262
},
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 10
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 4
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 6
},
{
"name": "latent_image",
"type": "LATENT",
"link": 2
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
7
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
282360350380822,
"randomize",
4,
1,
"lcm",
"simple",
1
]
},
{
"id": 12,
"type": "SaveImage",
"pos": [
1479,
189
],
"size": {
"0": 520.0657348632812,
"1": 575.7232666015625
},
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 12
}
],
"properties": {},
"widgets_values": [
"ComfyUI"
]
},
{
"id": 6,
"type": "CLIPTextEncode",
"pos": [
415,
186
],
"size": {
"0": 422.84503173828125,
"1": 164.31304931640625
},
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 3
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
4
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"evening sunset scenery blue sky nature, glass bottle with a galaxy in it"
]
}
],
"links": [
[
2,
5,
0,
3,
3,
"LATENT"
],
[
3,
4,
1,
6,
0,
"CLIP"
],
[
4,
6,
0,
3,
1,
"CONDITIONING"
],
[
5,
4,
1,
7,
0,
"CLIP"
],
[
6,
7,
0,
3,
2,
"CONDITIONING"
],
[
7,
3,
0,
8,
0,
"LATENT"
],
[
8,
4,
2,
8,
1,
"VAE"
],
[
10,
10,
0,
3,
0,
"MODEL"
],
[
12,
8,
0,
12,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 1.210000000000001,
"offset": [
-4.060897489580278,
-6.3444049642993585
]
}
},
"version": 0.4
}
@tianweiy
Copy link

@comfyanonymous Thank you for supporting it! I have one question. How is the specific timestep determined in the LCMScheduler implemented in ComfyUI?

Basically, if we set the number of step to 4, the LCMScheduler implemented in diffuser will use the following timesteps

[999, 759, 499, 259]

which is not the same as the one we used for training

[999, 749, 499, 249]

I am wondering if ComfyUI has similar problem or not as it might impact performance.

Thank you again for supporting this!

@comfyanonymous
Copy link
Author

ComfyUI doesn't use any diffusers code and splits schedulers and samplers so you can pick both individually. There are a few different schedulers and the "simple" scheduler with 4 steps will give timesteps [999, 749, 499, 249] on sdxl which is why this workflow works.

@tianweiy
Copy link

that's great. Thank you for the clarification.

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