VRAM 8 GB で Qwen Image(Edit)を ComfyUI で実行する
この記事では Q3_K_M 量子化(Qwen Image)と Q4_K_M(Qwen Image Edit)のモデルを使う。Block swap で巨大モデルを動かす方法は Qwen image x ブロックスワップ x 高速化Lora@ComfyUI x paperspace を参照。
最新の ComfyUI は VRAM から溢れるブロックを RAM に退避して処理を実行できる。Qwen Image Edit は Q4_K_M 以上でないとノイズが乗る。
モデル
配置場所 | モデル |
---|---|
models/unet | Qwen_Image-Q3_K_M.gguf |
models/unet | Qwen_Image_Edit-Q4_K_M.gguf |
models/text_encoders | Qwen2.5-VL-7B-Instruct-Q4_K_M.gguf |
models/text_encoders | mmproj-Qwen2.5-VL-7B-Instruct-Q8_0.gguf |
models/vae | qwen_image_vae.safetensors |
models/lora | lightx2v/Qwen-Image-Lightning |
高速化 LoRA の Qwen-Image-Lightning は動作させるだけなら不要だが、モデルを常用するなら必須。
量子化比較
city96/Qwen-Image-gguf の例では、Q6_K 以上はほぼ BF16 と同じ。
Comparison of Qwen-Image-Edit GGUF models によると、Qwen Image Edit は Q4_K_M が品質容量比でベストで、これ以上は差がほとんどない。
FP8 VS Q8_0
大抵の GPU は FP8 のまま計算できないので、内部的に FP16 で計算する。FP8 演算に対応しているのは NVIDIA H100/Hopper, RTX6000 Ada, RTX 4090/50xx Blackwell, AMD MI300X など。
Q8_0 は INT8 tensor cores があれば実行でき、大抵の NVIDIA のハードウェアで実行できる。
Text encoder
指定方法
CLIPLoader (GGUF) で Qwen2.5-VL-7B-Instruct-Q4_K_M.gguf を指定する。mmproj-Qwen2.5-VL-7B-Instruct-Q8_0.gguf は自動的に読み込まれる。
それ以外の量子化
4 bit 以外の量子化は unsloth/Qwen2.5-VL-7B-Instruct-GGUF から入手できる。
FP8 は qwen_2.5_vl_7b_fp8_scaled.safetensors から入手できる。
ワークフロー
「ComfyUI の左上のワークフロー > テンプレートを参照」の画像タブから基本のワークフローをロードできる。
下の画像をクリックした先の画像を ComfyUI にドラッグするとワークフローが読み込まれる。
T2I・Qwen Image Q3_K_M・4 step 高速化 LoRA・CFG 1
プロンプト:The illustration of a blonde girl wearing a blue kimono. She stands indoors in a Japanese house.
ネガティブプロンプト:なし
I2I・Qwen Image Edit Q4_K_M・4 step 高速化 LoRA・CFG 1
プロンプト:Change the color of her kimono to red and change her hair color to brown and change her eye color to green. Change her mouth to open and smile. Change her pose to make a heart with her hands in front of her chest.
ネガティブプロンプト:なし
Qwen Image Edit の Q3_K_M はそのまま使うと画質が悪い。以下の対処法ですこしましになる。
動作速度
高速化 LoRA を使わない場合、CFG ありの 20 step あたりが品質の許容範囲。CFG なしだったり steps が 20 未満だと画像がソフトになりやすい。
環境
- OS:Win11 24H2
- RAM:DDR4 32GB
- GPU:RTX3050
- VRAM:8 GB
- torch 2.7.1+cu128
T2I(Qwen Image Q3_K_M)・高速化 LoRA なし・CFG 2
解像度 | サンプル速度(s/it) | 20 step にかかる時間(min) | VRAM 使用量(GB) | RAM のピーク使用量(GB) |
---|---|---|---|---|
1152x 896 | 17.5 | 6 | 7.5 | 29 |
896x1328 | 21.0 | 7 | 7.5 | 29 |
1056x1584 | 26.0 | 9 | 7.7 | 29 |
T2I(Qwen Image Q3_K_M)・4 step 高速化 LoRA・CFG 1
1056x1584 で 4 step 高速化 LoRA を CFG 1 で実行すると 4 step に 1 分かかる。
VRAM 8 GB でも 1584 x 2048 の画像を生成でき、4 step 高速化 LoRA ・CFG 1 の場合 2 分かかる。
I2I(Qwen Image Edit Q4_K_M)・4 step 高速化 LoRA・解像度 1056x1584・CFG 1
- サンプル速度 27 s/it
- 8 step の生成に 3 分
- VRAM 使用量 7.5 GB
- RAM 使用量のピーク 29 GB
解像度リスト
Qwen Image のネイティブ解像度は 1,328 x 1,328。
アスペクト比 | ピクセル数 |
---|---|
1:1 | 1328 x 1328 |
16:9 | 1664 x 928 |
9:16 | 928 x 1664 |
4:3 | 1472 x 1104 |
3:4 | 1104 x 1472 |
3:2 | 1584 x 1056 |
2:3 | 1056 x 1584 |
拡張解像度
ここまでの解像度なら分裂せずに、アップスケールなしで生成できる可能性が高い。16:9 は分裂した。
アスペクト比 | ピクセル数 |
---|---|
1:1 | 1792 x 1792 |
2:3 | 1472 x 2176 |
3:4 | 1584 x 2048 |
プロンプト
Qwen Image(Edit)は生成される画像に多様性がない。なのでシードガチャは無意味で、適切なプロンプトの編集能力が重要になる。
プロンプトガイド
- Awesome-Nano-Banana-images
- グーグルの画像生成AI「Nano Banana」は異次元レベル AIコンテンツの作り方を根本から変えた
- Googleの画像生成AI「Nano-banana」をめちゃくちゃ活用できるプロンプトとサンプル画像実例まとめ
- Gemini を使った画像生成(別名 Nano Banana)
- How to prompt Gemini 2.5 Flash Image Generation for the best results
- Geminiの「Nano Banana」で不動産写真の家具を消してみた話
- Qwen-Image-Edit Prompt Guide: The Complete Playbook
- Qwen-Image: Prompt & Parameter Guide
- Simple multiple images input in Qwen-Image-Edit
- Tips for getting the best image generation and editing in the Gemini app
Dynamic Prompt
ComfyUI はデフォルトで Dynamic Prompt が使える。プロンプトに {A|B|C} と入力すると、実行するごとに A, B, C がランダムに選択される。
年齢
child, girl, woman, mature woman の4段階制御。years old 指定だと若干変化がつけられる。
画風
- in realistic photography style, high detail
- cinematic high-fashion lighting
- in sketch drawing style
- black and white outline
- oil painting
- watercolor
- charcoal drawing
- cartoon/anime style
- pixel art
- vector illustration
- Renaissance painting
- Art Deco style
- Japanese ukiyo-e
- Studio Ghibli art style
- Kyoto Animation art style
ワークフロー
Qwen Image Edit - Image To Dataset Workflow
Qwen Edit 3 Image Combine Workflow
作例
設定は 4 step 高速化 LoRA・CFG 1

The illustration of a chibi girl sitting in a chair eating a piece of pizza. She is saying "This is fine!" in a speech bubble. There is a table and a window in the indoor room.

Two girls are embracing each other while taking a selfie in the noon park.The left girl has blonde hair with a hair clip and blue eyes and closed mouth. The right girl has black long hair and red eyes and open mouth. They are wearing school uniforms and looking at smartphone. Kyoto Animation art style.

The illustration of the full length portrait of a standing girl with her arms at sides on a pure white background. She has large breasts. She is wearing a navy blazer, white collared shirt, a red string ribbon, white socks, dark brown loafers and a gingham pleated mini skirt. Pure white background.

Convert the character illustration into a turnaround sheet. Create three different full-body poses on a pure white background: left profile view on the left, back view on the middle, and right profile view on the right.
元のプロンプトは The character illustration on the far left will be converted into a turnaround sheet. Create four different full-body poses on a pure white background: front view on the far left, left profile view on the middle left, back view on the middle right, and right profile view on the far right. 出典:https://x.com/tori29umai/status/1959502270816772591。