ComfyUI で Stable Cascade を利用する - Stable Diffusion

ComfyUI で Stable Cascade を利用するための設定手順を紹介します。

手順

Stable Cascadeのモデルのダウンロード

Stable Cascadeのモデルをダウンロードします。手順はこちらの記事を参照してください。

モデルの配置

Stable CascadeのモデルをConfyUIのディレクトリに配置します。
(ComfyUI の配置ディレクトリ)\ComfyUI\models\vae ディレクトリに stage Aのモデル stage_a.safetensors を配置します。


(ComfyUI の配置ディレクトリ)\ComfyUI\models\unet ディレクトリに stage Bとstage Cのモデル stage_b.safetensors stage_c.safetensors を配置します。


(ComfyUI の配置ディレクトリ)\ComfyUI\models\clip ディレクトリに テキストエンコーダーのモデル model.safetensors を配置します。

ComfyUIのアップデート

ComfyUIを最新バージョンに更新します。
(ComfyUI の配置ディレクトリ)\update\ ディレクトリの update_comfyui_and_python_dependencies.bat を実行します。 ComfyUIの更新やライブラリのバージョン更新が実行されます。

ComfyUIの実行

(ComfyUI の配置ディレクトリ)\run_nvidia_gpu.bat または run_cpu.bat ファイルを実行します。


Webブラウザが開き、ComfyUIの画面が表示されます。

ComfyUIの設定

ページ末尾のWorkflowのJSONファイルを読み込みます。下図の状態になります。


ワークフローの一番左側には2つのUNET Loaderと CLIPのLoaderのノードがあります。


上部のUNET Loaderには Stage Bのモデルを設定します。


下部のUNET Loaderには Stage Cのモデルを設定します。


CLIPのLoaderにはテキストエンコーダーのモデルを設定します。


また、Typeの設定を"stable_cascade"に設定します。


CLIP Text Encodeのノードは2つあります。上部のノードにプロンプトを、下部のノードにネガティブプロンプトを入力します。


KSamplerのノードは2つあります。左側のノードにはStage Cのモデルを設定します。右側のノードにはStage Bのモデルを設定します。


VAEのLoaderには、Stage Aのモデルを設定します。


設定ができたら、[Queue Prompt]ボタンをクリックして画像を生成します。生成された画像が、[Save Image]ノードに表示されます。


今回の例では下図の画像が生成できました。
Settings
Prompt:beautiful scenery nature glass bottle landscape, , purple galaxy bottle,
Negative prompt: (なし)
Size: 1024x1024

Workflow JSON

stable-cascade-workflow.json
{
  "last_node_id": 40,
  "last_link_id": 109,
  "nodes": [
    {
      "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
          ],
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "CLIPTextEncode"
      },
      "widgets_values": [
        ""
      ]
    },
    {
      "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": 36,
      "type": "StableCascade_StageB_Conditioning",
      "pos": [
        963,
        281
      ],
      "size": {
        "0": 277.20001220703125,
        "1": 46
      },
      "flags": {},
      "order": 9,
      "mode": 0,
      "inputs": [
        {
          "name": "conditioning",
          "type": "CONDITIONING",
          "link": 105
        },
        {
          "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"
      }
    },
    {
      "id": 40,
      "type": "ConditioningZeroOut",
      "pos": [
        719,
        236
      ],
      "size": {
        "0": 211.60000610351562,
        "1": 26
      },
      "flags": {},
      "order": 7,
      "mode": 0,
      "inputs": [
        {
          "name": "conditioning",
          "type": "CONDITIONING",
          "link": 109
        }
      ],
      "outputs": [
        {
          "name": "CONDITIONING",
          "type": "CONDITIONING",
          "links": [
            104,
            105
          ],
          "shape": 3,
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "ConditioningZeroOut"
      }
    },
    {
      "id": 29,
      "type": "VAELoader",
      "pos": [
        1272,
        569
      ],
      "size": {
        "0": 315,
        "1": 58
      },
      "flags": {},
      "order": 1,
      "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": 11,
      "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": 12,
      "mode": 0,
      "inputs": [
        {
          "name": "images",
          "type": "IMAGE",
          "link": 9
        }
      ],
      "properties": {},
      "widgets_values": [
        "wuer/ComfyUI"
      ]
    },
    {
      "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,
            109
          ],
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "CLIPTextEncode"
      },
      "widgets_values": [
        "beautiful scenery nature glass bottle landscape, , purple galaxy bottle,"
      ]
    },
    {
      "id": 3,
      "type": "KSampler",
      "pos": [
        616,
        315
      ],
      "size": {
        "0": 315,
        "1": 262
      },
      "flags": {},
      "order": 8,
      "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": 10,
      "mode": 0,
      "inputs": [
        {
          "name": "model",
          "type": "MODEL",
          "link": 84,
          "slot_index": 0
        },
        {
          "name": "positive",
          "type": "CONDITIONING",
          "link": 86
        },
        {
          "name": "negative",
          "type": "CONDITIONING",
          "link": 104
        },
        {
          "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": 32,
      "type": "UNETLoader",
      "pos": [
        -240,
        192
      ],
      "size": {
        "0": 315,
        "1": 58
      },
      "flags": {},
      "order": 2,
      "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": 30,
      "type": "UNETLoader",
      "pos": [
        -239,
        287
      ],
      "size": {
        "0": 315,
        "1": 58
      },
      "flags": {},
      "order": 3,
      "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": 4,
      "mode": 0,
      "outputs": [
        {
          "name": "CLIP",
          "type": "CLIP",
          "links": [
            93,
            94
          ],
          "shape": 3,
          "slot_index": 0
        }
      ],
      "properties": {
        "Node name for S&R": "CLIPLoader"
      },
      "widgets_values": [
        "model.safetensors",
        "stable_cascade"
      ]
    }
  ],
  "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"
    ],
    [
      104,
      40,
      0,
      33,
      2,
      "CONDITIONING"
    ],
    [
      105,
      40,
      0,
      36,
      0,
      "CONDITIONING"
    ],
    [
      107,
      6,
      0,
      3,
      1,
      "CONDITIONING"
    ],
    [
      108,
      7,
      0,
      3,
      2,
      "CONDITIONING"
    ],
    [
      109,
      6,
      0,
      40,
      0,
      "CONDITIONING"
    ]
  ],
  "groups": [],
  "config": {},
  "extra": {},
  "version": 0.4
}
著者
iPentecのメインデザイナー
Webページ、Webクリエイティブのデザインを担当。PhotoshopやIllustratorの作業もする。
掲載日: 2024-02-21
iPentec all rights reserverd.