Add example workflow

This commit is contained in:
asagi4
2024-03-23 22:54:13 +02:00
parent 42a84c7874
commit 9a6d6445bc
2 changed files with 762 additions and 0 deletions
+2
View File
@@ -4,6 +4,8 @@ Attempts to implement [CADS](https://arxiv.org/abs/2310.17347) for ComfyUI.
Credit also to the [A1111 implementation](https://github.com/v0xie/sd-webui-cads/tree/main) that I used as a reference.
There isn't any real way to tell what effect CADS will have on your generations, but you can load [this example workflow](workflows/CADScompare.json?raw=1) into ComfyUI to compare between CADS and non-CADS generations.
# Usage
Apply the node to a model and set `noise_scale` > 0.0.
+760
View File
@@ -0,0 +1,760 @@
{
"last_node_id": 23,
"last_link_id": 29,
"nodes": [
{
"id": 13,
"type": "Reroute",
"pos": [
1095,
15
],
"size": [
75,
26
],
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "",
"type": "*",
"link": 14
}
],
"outputs": [
{
"name": "",
"type": "VAE",
"links": [
16,
27
]
}
],
"properties": {
"showOutputText": false,
"horizontal": false
}
},
{
"id": 8,
"type": "VAEDecode",
"pos": [
1110,
210
],
"size": {
"0": 210,
"1": 46
},
"flags": {
"collapsed": true
},
"order": 10,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 15,
"slot_index": 0
},
{
"name": "vae",
"type": "VAE",
"link": 16,
"slot_index": 1
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
17
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 21,
"type": "VAEDecode",
"pos": [
1125,
600
],
"size": {
"0": 231,
"1": 46
},
"flags": {
"collapsed": true
},
"order": 11,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 26
},
{
"name": "vae",
"type": "VAE",
"link": 27,
"slot_index": 1
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
28
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 4,
"type": "CheckpointLoaderSimple",
"pos": [
15,
480
],
"size": {
"0": 315,
"1": 98
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
11,
29
],
"slot_index": 0
},
{
"name": "CLIP",
"type": "CLIP",
"links": [
3,
5
],
"slot_index": 1
},
{
"name": "VAE",
"type": "VAE",
"links": [
14
],
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": [
"XL/animagine-xl-3.1.safetensors"
]
},
{
"id": 15,
"type": "KSampler",
"pos": [
1110,
180
],
"size": [
240,
450
],
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 29,
"slot_index": 0
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 22,
"slot_index": 1
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 23,
"slot_index": 2
},
{
"name": "latent_image",
"type": "LATENT",
"link": 24,
"slot_index": 3
},
{
"name": "seed",
"type": "INT",
"link": 25,
"widget": {
"name": "seed"
},
"slot_index": 4
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
26
],
"shape": 3,
"slot_index": 0
}
],
"title": "KSampler (no CADS)",
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
1,
"randomize",
20,
8,
"euler_ancestral",
"normal",
1
]
},
{
"id": 11,
"type": "CADS",
"pos": [
15,
210
],
"size": {
"0": 315,
"1": 226
},
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 11
}
],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
12
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CADS"
},
"widgets_values": [
0.25,
0.6,
0.9,
0,
-1,
-1,
"uncond",
"y"
]
},
{
"id": 10,
"type": "KSampler",
"pos": [
870,
180
],
"size": [
225,
450
],
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 12
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 10
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 19,
"slot_index": 2
},
{
"name": "latent_image",
"type": "LATENT",
"link": 18
},
{
"name": "seed",
"type": "INT",
"link": 13,
"widget": {
"name": "seed"
},
"slot_index": 4
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
15
],
"shape": 3
}
],
"title": "KSampler (CADS)",
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
1,
"randomize",
20,
8,
"euler_ancestral",
"normal",
1
]
},
{
"id": 23,
"type": "Note",
"pos": [
15,
615
],
"size": [
315,
135
],
"flags": {},
"order": 1,
"mode": 0,
"properties": {
"text": ""
},
"widgets_values": [
"Play around with the values.\nCADS adds some randomness into the conditioning, which can help produce more varied outputs."
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 5,
"type": "EmptyLatentImage",
"pos": [
420,
615
],
"size": {
"0": 315,
"1": 106
},
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
18,
24
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "EmptyLatentImage"
},
"widgets_values": [
896,
1152,
1
]
},
{
"id": 7,
"type": "CLIPTextEncode",
"pos": [
420,
390
],
"size": {
"0": 425.27801513671875,
"1": 180.6060791015625
},
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 5
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
19,
23
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"nsfw, very displeasing, worst quality, low quality,"
]
},
{
"id": 6,
"type": "CLIPTextEncode",
"pos": [
420,
180
],
"size": {
"0": 422.84503173828125,
"1": 164.31304931640625
},
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 3
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
10,
22
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"(very aesthetic), newest, masterpiece, best quality, fox ears, girl, holding a bottle, swirling liquid, galaxy pattern in bottle,"
]
},
{
"id": 14,
"type": "PreviewImage",
"pos": [
1380,
-15
],
"size": [
255,
375
],
"flags": {},
"order": 12,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 17
}
],
"title": "CADS",
"properties": {
"Node name for S&R": "PreviewImage"
}
},
{
"id": 22,
"type": "PreviewImage",
"pos": [
1380,
405
],
"size": [
255,
360
],
"flags": {},
"order": 13,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 28
}
],
"title": "No CADS",
"properties": {
"Node name for S&R": "PreviewImage"
}
},
{
"id": 12,
"type": "PrimitiveNode",
"pos": [
15,
90
],
"size": {
"0": 210,
"1": 75
},
"flags": {},
"order": 3,
"mode": 0,
"outputs": [
{
"name": "INT",
"type": "INT",
"links": [
13,
25
],
"widget": {
"name": "seed"
}
}
],
"title": "Seed",
"properties": {
"Run widget replace on values": false
},
"widgets_values": [
1,
"fixed"
]
}
],
"links": [
[
3,
4,
1,
6,
0,
"CLIP"
],
[
5,
4,
1,
7,
0,
"CLIP"
],
[
10,
6,
0,
10,
1,
"CONDITIONING"
],
[
11,
4,
0,
11,
0,
"MODEL"
],
[
12,
11,
0,
10,
0,
"MODEL"
],
[
13,
12,
0,
10,
4,
"INT"
],
[
14,
4,
2,
13,
0,
"*"
],
[
15,
10,
0,
8,
0,
"LATENT"
],
[
16,
13,
0,
8,
1,
"VAE"
],
[
17,
8,
0,
14,
0,
"IMAGE"
],
[
18,
5,
0,
10,
3,
"LATENT"
],
[
19,
7,
0,
10,
2,
"CONDITIONING"
],
[
22,
6,
0,
15,
1,
"CONDITIONING"
],
[
23,
7,
0,
15,
2,
"CONDITIONING"
],
[
24,
5,
0,
15,
3,
"LATENT"
],
[
25,
12,
0,
15,
4,
"INT"
],
[
26,
15,
0,
21,
0,
"LATENT"
],
[
27,
13,
0,
21,
1,
"VAE"
],
[
28,
21,
0,
22,
0,
"IMAGE"
],
[
29,
4,
0,
15,
0,
"MODEL"
]
],
"groups": [],
"config": {},
"extra": {
"groupNodes": {}
},
"version": 0.4
}