📦 ComfyUI 工作流

以下工作流已於 V100 32GB + ComfyUI-GGUF + Qwen Image Edit 實測通過。 下載後直接匯入 ComfyUI 即可使用。

🖼️ Text-to-Image 工作流

純文字生圖。適合從 scratch 創作。denoise = 1.0。

{
  "1": {
    "class_type": "UnetLoaderGGUF",
    "inputs": {
      "unet_name": "Qwen_Image_Edit-Q4_K_M.gguf"
    }
  },
  "2": {
    "class_type": "CLIPLoader",
    "inputs": {
      "clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors",
      "type": "qwen_image"
    }
  },
  "3": {
    "class_type": "CLIPTextEncode",
    "inputs": {
      "text": "吉卜力工作室風格,宮崎駿水彩畫風,柔和的陽光,翠綠的草地",
      "clip": [
        "2",
        0
      ]
    }
  },
  "4": {
    "class_type": "VAELoader",
    "inputs": {
      "vae_name": "qwen_image_vae.safetensors"
    }
  },
  "5": {
    "class_type": "EmptySD3LatentImage",
    "inputs": {
      "width": 512,
      "height": 512,
      "batch_size": 1
    }
  },
  "6": {
    "class_type": "KSampler",
    "inputs": {
      "model": [
        "1",
        0
      ],
      "seed": 42,
      "steps": 20,
      "cfg": 7,
      "sampler_name": "euler",
      "scheduler": "normal",
      "positive": [
        "3",
        0
      ],
      "negative": [
        "3",
        0
      ],
      "latent_image": [
        "5",
        0
      ],
      "denoise": 1
    }
  },
  "7": {
    "class_type": "VAEDecode",
    "inputs": {
      "samples": [
        "6",
        0
      ],
      "vae": [
        "4",
        0
      ]
    }
  },
  "8": {
    "class_type": "SaveImage",
    "inputs": {
      "images": [
        "7",
        0
      ],
      "filename_prefix": "output"
    }
  }
}

🔄 Img2Img 風格轉換工作流

照片風格轉換。將圖片放入 ComfyUI input/ 目錄。denoise = 0.5(最佳平衡)。

{
  "1": {
    "class_type": "UnetLoaderGGUF",
    "inputs": {
      "unet_name": "Qwen_Image_Edit-Q4_K_M.gguf"
    }
  },
  "2": {
    "class_type": "CLIPLoader",
    "inputs": {
      "clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors",
      "type": "qwen_image"
    }
  },
  "3": {
    "class_type": "CLIPTextEncode",
    "inputs": {
      "text": "吉卜力工作室風格,宮崎駿水彩畫風",
      "clip": [
        "2",
        0
      ]
    }
  },
  "4": {
    "class_type": "VAELoader",
    "inputs": {
      "vae_name": "qwen_image_vae.safetensors"
    }
  },
  "5": {
    "class_type": "LoadImage",
    "inputs": {
      "image": "input_image.png"
    }
  },
  "6": {
    "class_type": "VAEEncode",
    "inputs": {
      "pixels": [
        "5",
        0
      ],
      "vae": [
        "4",
        0
      ]
    }
  },
  "7": {
    "class_type": "KSampler",
    "inputs": {
      "model": [
        "1",
        0
      ],
      "seed": 12345,
      "steps": 30,
      "cfg": 8.5,
      "sampler_name": "euler",
      "scheduler": "normal",
      "positive": [
        "3",
        0
      ],
      "negative": [
        "3",
        0
      ],
      "latent_image": [
        "6",
        0
      ],
      "denoise": 0.5
    }
  },
  "8": {
    "class_type": "VAEDecode",
    "inputs": {
      "samples": [
        "7",
        0
      ],
      "vae": [
        "4",
        0
      ]
    }
  },
  "9": {
    "class_type": "SaveImage",
    "inputs": {
      "images": [
        "8",
        0
      ],
      "filename_prefix": "output"
    }
  }
}

📋 模型安裝清單

使用前請確認以下模型已安裝:

組件檔名路徑
UNet Qwen_Image_Edit-Q4_K_M.gguf models/unet/
CLIP qwen_2.5_vl_7b_fp8_scaled.safetensors models/clip/
VAE qwen_image_vae.safetensors models/vae/
mmproj Qwen2.5-VL-7B-Instruct-mmproj-BF16.gguf models/text_encoders/mmproj/

⚡ 使用方式

  1. 下載 JSON 檔案
  2. 打開 ComfyUI Web UI
  3. 點擊 Load → 選擇下載的 JSON 檔案
  4. 修改 CLIPTextEncode 節點的 text 參數
  5. img2img: 將圖片放入 ComfyUI/input/ 目錄
  6. 按下 Queue Prompt 開始生成