見出し画像

ComfyUIでFP8/GGUF版のQwen-Imageを試す(要VRAM 12~16GB)

Last update 8-7-2025
高速に生成できるQwen-Image-Lightning等の記事と、画像の編集ができるQwen-Image-Editの記事もあります。
※ (9-7-2025) 設置場所の記載ミス(誤:qwen-image 正:qwen_image)は後ほど修正します。ワークフローも更新予定です(機能的は現状と変わりません)。少々お待ちください。
※ (8-16-2025) VRAM 12GBの環境でFP8版の動作を確認しました。VRAM(占有GPUメモリ)をできるだけ空けてください。
※ 関連記事は、ComfyUIの記事一覧にまとめてあります。




■ 0. 概要

▼ 0-0. はじめに

 本記事では、ComfyUIで「Qwen-Image」を利用するための手順を説明します。モデルはFP8版とGGUF版を利用します。

 ComfyUIのインストール方法は、下記の記事をご覧ください。


▼ 0-1. Qwen-Imageについて

 Qwen-Imageは、Alibabaが開発しているQwenファミリーの一つとして登場した画像生成モデルで、8-4-2025に発表(X上では翌日未明)されたばかりです。その品質もさることながら、テキスト描画は「英語はGPT-4oに匹敵」とうたわれています。

 Text EncoderがLLMなので、モデル自体は英語や中国語のプロンプトに特化しているとみられますが、日本語も一応通るようです。

 ライセンスについては、「Qwen-Image is licensed under Apache 2.0.」との記述があります。

 パラメーター数は20Bで、SDXLが3.5B、SD 3.5 Largeが8B、FLUX.1が12B、HiDream-I1が17Bですので、ローカルPCで利用できるものとしては最大クラスです。

 下記はComfy Org(ComfyUIの開発元)による記事です。


▼ 0-2. 関連リンク1

 無料で生成のおためしができます。

 生成AIプレイグラウンドのfalも利用可能です。$0.02/MP で、1MPであれば1枚15秒ほどで生成ができます。


▼ 0-3. 関連リンク2

 公式のモデルです。

 興味深いところとして、ロスレス圧縮によりサイズが32%小さくなったDF11形式のモデルが存在します。

 本記事で利用するモデルです。詳細は記事中で説明します。

 GGUF版のモデルを利用する場合に必要な拡張機能です。

 下記も同様です。参考程度に情報を追加しました。



■ 1. 使用リソース

▼ 1-1. VRAM使用量

 FP8版の場合、VRAM 12~16GBを最大限に利用します。GGUF版のQ4_K_Mの場合、VRAM 12GBを最大限に利用するとみられます(未確認)。

 ComfyUIの仕組み上、VRAM使用量は必要最小限ではなく多めになります。下記は参考としてご覧ください。

 筆者の環境(VRAM 16GB、アイドル時の使用量は1.5GB程度とする)では、Text Encoderのロード時に9.1GB程度、生成時はModelがFP8形式の場合で15.4GB(ほぼ上限)、GGUF形式のQ4_K_Mでは13.3GB程度となりました。

VRAMの使用量(FP8版、左側の山はText Encoderによる)

▼ 1-2. 生成時間

 下記は筆者の環境(RTX 5060 Ti)にて、FP8版またはGGUF版のQ4_K_Mを利用した場合の、1枚あたりの生成時間です。

  • FP8
    175秒程度、95秒程度(CFG=1.0)

  • GGUF (Q4_K_M)
    205秒程度、102秒程度(CFG=1.0)

 CFGを1.0にするとかなり早くなりますが、この場合はSamplerをres_multistep等にするのが良いとのことです。



■ 2. 準備(FP8版)

▼ 2-1. はじめに

 必要な情報はComfyUI Examplesに記載されています。

掲載されているワークフロー

 下記は、ComfyUIがQwen-Imageをサポートした当初の情報です。

掲載されているワークフロー(WIP)

▼ 2-2. モデルの設置

 筆者は種類ごとにディレクトリを分けているのでそのように記述しますが、お好みで決めていただいて構いません。

 下記のURLより、すべてのモデルがダウンロードできます。ファイルをダウンロードして、適切なフォルダへ移動します。

  • Comfy-Org/Qwen-Image_ComfyUI
    https://huggingface.co/Comfy-Org/Qwen-Image_ComfyUI  

    • split_files/diffusion_models/
      qwen_image_fp8_e4m3fn.safetensors (19.0GB)
      → models\diffusion_models\qwen-image\

    • split_files/text_encoders/
      qwen_2.5_vl_7b_fp8_scaled.safetensors (8.73GB)
      → models\text_encoders\qwen-image\

    • split_files/vae/
      qwen_image_vae.safetensors (242MB)
      → models\vae\qwen-image\



■ 3. 生成(FP8版)

▼ 3-1. 概要

 生成用のワークフローを提供しますので、改造、再公開を含め自由にご利用ください。


▼ 3-2. 補足

 パラメーターの値(ModelSampling、Steps、CFG、Sampler、Scheduler)は変更が可能です。提供するワークフローの設定値は参考としてください。

 CFGを1.0にすると生成時間が半分程度に短縮されます。この場合、Samplerをres_multistep等にするのが良いとの情報があります。


▼ 3-3. ワークフローと生成例

 下記のファイルをダウンロードして、ComfyUIの画面にドラッグ&ドロップしてください。

 ワークフローは下記の画像のようになっています。プロンプトは、既存の生成画像をChatGPT o4-miniに読み込ませ、指示を与えて改良しました。

ワークフローの全体

 解像度は、公式には「1328 x 1328 (1:1)」「1472 x 1140 (4:3)」「1140 x 1472 (3:4)」「1664 x 928 (16:9)」「928 x 1664 (9:16)」の5種類が挙げられています。Stepsは20、CFGは4.0です。

An ultra-detailed high-resolution anime-style digital painting with photorealistic lighting and contrast depicting a joyful young girl sitting at the shoreline of a tropical beach under golden sunlight, featuring pastel pink twin-tail hair with individual strand highlights held by dark ribbon bows, large sky-blue irises with glossy specular reflections and soft blush on her cheeks, wearing a light blue-white gingham bikini and matching fluttering skirt, her glistening skin dotted with realistic water droplets and subtle pores, shallow clear water lapping around her smooth legs creating crisp white foam, refractive caustic patterns dancing across wet sand that mirrors the sky, a curved crescent shore leading to lush green hills dotted with swaying palm trees under a vibrant blue sky filled with volumetric sunbeams, fluffy clouds with depth and shadow, and gentle lens flares, using a rich warm color palette, strong dynamic contrast, painterly watercolor textures blended with fine linework, delicate bloom effects, realistic photometric lighting and atmospheric depth reminiscent of modern anime feature films.



■ 4. 準備(GGUF版)

▼ 4-1. はじめに

 オリジナルのモデルが登場した後、有志の手によってFP8形式、DF11形式、NF4形式、そしてGGUF形式に変換されて公開されています。GGUF版も動作確認がとれたので紹介します。


▼ 4-2. モデルの設置

 Modelをダウンロードして、適切なフォルダへ移動します。Q4_K_Mでおよそ十分な品質となりますが、VRAM使用量と品質を見ながら上げ下げすることができます。

 Text Encoderをダウンロードして、適切なフォルダへ移動します。

 VAEは、FP8版で提供されたものを利用します。設置済みであればスキップしてください。


▼ 4-3. 拡張機能のインストール1

 ComfyUIでGGUF形式のモデルを利用するためには、下記の拡張機能が必要です。

 もし、「ComfyUI\custom_nodes\ComfyUI-GGUF\」のフォルダが存在しない場合はインストールを行ってください。

 ComfyUI-GGUFの導入手順を説明するための記事がまだできていないので、ComfyUI Managerからインストールするか、下記の記事の4-2.を参照して手動でインストールしてください。

 生成を開始できずにエラーが出る場合は、拡張機能のアップデートが必要です。


▼ 4-4. 拡張機能のインストール2(参考)

 4-3. の他にもGGUF形式に対応する拡張機能があります。こちらの特徴は、VAEもGGUF形式が利用できる点です。どちらを選んでも構いません(共存もできます)。

 導入手順については、概要のみを簡単に説明します。下記のリポジトリをクローンして、「gguf」のパッケージをインストールすれば完了です。

 Modelは下記のURLからダウンロードできます。Text EncoderやVAEへのリンクもあります。ModelとText Encoderは、4-2.に掲載したものも利用できます。



■ 5. 生成(GGUF版)

▼ 5-1. 概要

 生成用のワークフローを提供しますので、改造、再公開を含め自由にご利用ください。ModelとText Encoderの読み込み部分を除いて、FP8版と共通です。 


▼ 5-2. 補足

 パラメーターの値(ModelSampling、Steps、CFG、Sampler、Scheduler)は変更が可能です。提供するワークフローの設定値は参考としてください。

 CFGを1.0にすると生成時間が半分程度に短縮されます。この場合、Samplerをres_multistep等にするのが良いとの情報があります。


▼ 5-3. ワークフローと生成例

 下記のファイルをダウンロードして、ComfyUIの画面にドラッグ&ドロップしてください。

 ワークフローの全体と生成画像です

ワークフローの全体
An ultra-detailed high-resolution anime-style digital painting with photorealistic lighting and contrast depicting a joyful young girl sitting at the shoreline of a tropical beach under golden sunlight, featuring pastel pink twin-tail hair with individual strand highlights held by dark ribbon bows, large sky-blue irises with glossy specular reflections and soft blush on her cheeks, wearing a light blue-white gingham bikini and matching fluttering skirt, her glistening skin dotted with realistic water droplets and subtle pores, shallow clear water lapping around her smooth legs creating crisp white foam, refractive caustic patterns dancing across wet sand that mirrors the sky, a curved crescent shore leading to lush green hills dotted with swaying palm trees under a vibrant blue sky filled with volumetric sunbeams, fluffy clouds with depth and shadow, and gentle lens flares, using a rich warm color palette, strong dynamic contrast, painterly watercolor textures blended with fine linework, delicate bloom effects, realistic photometric lighting and atmospheric depth reminiscent of modern anime feature films.

 おまけとして、4-4.の拡張機能を利用する場合のワークフローも掲載します。ModelとText Encoderの選択は先ほどのワークフローと同じなので、必要に応じて変更してください。



■ 6. おまけ

▼ 6-1. 概要

 Qwen-Imageで生成した画像を掲載します。プロンプトは過去の記事の使い回しばかりで、微妙に偏っていますが…。

 解像度は1664x928(16:9の比率)としています。従来のアーキテクチャでは1MP(16:9の場合は1344x768)の画素数が多かったので、1.7MPまで引き上げられて良好な品質が得られているのは非常に興味深いです。

A towering carrot, its roots transformed into muscular legs, stands defiantly in a vibrant vegetable garden. A mischievous tomato, with arms that dangle lazily, leans against a fence, while a determined potato, sprouting human arms and legs, wields a tiny hoe. In the background, a cucumber, with long, slender arms, climbs a trellis, its face etched with a thoughtful expression. The entire scene is bathed in a soft, golden light, casting playful shadows that dance across the garden.

 下記の画像はCFGを1.0に、Samplerをres_multistepに変更しています。ネガティブプロンプトが使えなくなると思いますが、生成時間が半分程度になることを加味すると悪くはなさそうです。

(プロンプトは同じ、CFG=1.0)

 引き続き、通常の設定での生成結果を掲載します。

A young girl with gray pigtails tied with white ribbons sits in a rural meadow filled with blooming spring flowers, photographed in high-end Japanese cosplay style with professional costume design and makeup. She wears an expertly tailored sky blue skirt with small white floral patterns and a pristine white ribbon blouse with detailed craftsmanship. The girl holds a cat in her arms while sitting in a meadow with colorful wildflowers. Behind her, a traditional farm village appears in the distance with snow-capped mountains on the horizon. Professional photography with natural lighting, sharp focus, and cinematic color grading. Hyperrealistic textures on the fabric and hair, with attention to practical effects and authentic costume details.
A young girl with gray pigtails tied with white ribbons sits in a rural meadow filled with blooming spring flowers. She wears a sky blue skirt with small white floral patterns and a white ribbon blouse. The girl holds a cat in her arms while sitting in a meadow with colorful wildflowers. Behind her, a traditional farm village appears in the distance with snow-capped mountains on the horizon. 3D anime MMORPG game screenshot style with UI overlay elements including a circular player portrait of the girl in the top-left corner, health and mana bars, level indicator, quest tracker on the right side, and a semi-transparent chat window in the bottom-left displaying player interactions. The interface features crystalline borders and fantasy-themed decorative elements with a modern minimalist design. High-quality real-time 3D rendering with detailed textures and ambient occlusion.
This is a face close-up shot, pastel colored, Japanese anime style artwork. There is a mother and her pre-teen daughter holding hands, make smiile , closed mouth and looking at each other with joy in a bustling daytime fantasy theme park. The daughter wearing a detailed pink magical princess costume. The mother wearing white blouse and navy long apron dress. There is the park under the bright summer sun, with colorful attractions, exciting rides, and lively food stalls. The mother's eyes sparkle with love and pride as she shares this special moment with her daughter. The background is filled with the hustle and bustle of the crowd, creating a sense of excitement and wonder. Include details like balloons floating in the clear blue sky, children running around with ice cream cones, and park mascots greeting visitors.

 Qwen-Imageは中国語のプロンプトが通用します(当然)。

日本平面色块动画风格。一位可爱的幼年魔法少女,长着深棕色的长发,穿着粉色和白色的荷叶边服装,上面点缀着缎带和蝴蝶结。她的脸颊微微泛红,眼神羞涩地低垂,露出天真又俏皮的微笑,身体微微向前倾。她手握一根心形宝石魔杖,站在夕阳映照下的热闹游乐园里,周围是五彩缤纷的游乐设施和沐浴在金色暖光中的模糊人群。整体呈现柔和的水彩画风,充满梦幻和怀旧的氛围。

 日本語のプロンプトも通ります。ただし、英語と中国語でトレーニングされたと考えられるので、過信はしない方が良いと思います。

アニメスタイルの水彩画。ロングヘアーの女の子が、白いドレスとサンダルの姿で微笑んでいます。女の子の隣には黒い猫がいます。周囲に花が咲く自然の断崖で、そのむこうに海と島が見えます。
Ultra-realistic portrait photograph of a young girl in a modern shopping mall, captured with a professional DSLR camera. Natural lighting streams through a grand glass dome ceiling visible in the background. She has medium brown hair styled in neat twin braids, striking gray eyes with natural depth, and a subtle, genuine smile. The girl is captured mid-movement, elegantly extending one hand while gracefully lifting one leg. She's wearing a sky-blue gothic lolita dress with intricate frilled hems and a prominent chest ribbon. Her outfit is completed with a matching headband, delicate white frilled socks, and polished black Mary Jane shoes. Photojournalistic style, shallow depth of field, soft natural lighting, 85mm lens, f/2.8.
A life-size pop-up display of a Japanese anime-style girl stands alone on the floor next to the entrance of a department store's indoor corridor with visible ceiling, amidst a crowd of people passing by. The word "Akari" is prominently displayed in large lettering below the pop-up. A short stature girl with shoulder-length brown straight hair and large, expressive brown eyes. Her hair is tied up in a high ponytail, with a few strands framing her cheerful face. She's wearing a light pink one-piece dress layered with a thin, white cardigan and comfortable flat sandals. She carries a small, cute shoulder bag. The style is Japanese anime, emphasizing her youthful appearance and expressive features. The background features the interior of a department store with bright indoor lighting from ceiling fixtures. The image is captured from a medium distance, showcasing the standalone cardboard pop-up figure of Akari as the main focus within the indoor shopping environment.
Anime illustration with soft nocturnal pastel hues and gentle moonlit glow capturing a magical summer evening in a theme park. Extreme close-up on a cheerful anime girl with shoulder-length wavy auburn hair adorned with a small yellow sunflower hair clip, her back to the viewer as she glances over her right shoulder, hazel eyes wide with wonder, her right hand gently resting on the wrought iron fence in front of her. The tight framing reveals only her upper back, flowing hair, the top of her sleeveless white sundress with tiny blue polka dots and her slender fingers wrapped around the fence. Directly behind her, brilliant fireworks burst in vivid colors, their reflections dancing on the lake’s surface just beyond the fence. Around her, a tightly packed crowd of silhouetted visitors fills the frame, faces turned skyward in awe. Overhead lanterns cast a soft glow on the nearest heads, while hints of illuminated ride structures peek through the gathering, creating an intimate, celebratory atmosphere.



■ 7. その他

 私が書いた他の記事は、メニューよりたどってください。

 ComfyUIに限定した記事の一覧もあります。

 記事に関することで何かありましたら、Xの@riddi0908までお願いします。

いいなと思ったら応援しよう!