私的AI研究会 > ComfyUI14a

画像生成AI「ComfyUI」14(実践編Ⅳ2) == 編集中 ==

 「ComfyUI」を使ってローカル環境でのAI画像生成を検証する

▲ 目 次
※ 最終更新:2026/06/06 

『HiDream-O1-Image』を検証する2

ローカル LLM でプロンプト・エンハンサー

「HiDream-O1-Image」のプロンプト・エンハンサーを「Ollama + OpenWebUI」を利用したローカルLLM で実現する
  1. 事前準備
    ・「open_webui」をアップデートする(Anaconda 環境)
      Windows  「Anaconda PowerShell」から
    (base) PS > conda activate open-webui
    (open-webui) PS > $env:DATA_DIR="C:\anaconda_win\workspace_3\open-webui\data"
    (open-webui) PS > $env:DATA_DIR
    (open-webui) PS > pip install -U open-webui
      Linux  「Anaconda ターミナル」から
    (base) $ conda activate open-webui
    (open-webui) $ export DATA_DIR=$HOME/workspace_3/open-webui/data
    (open-webui) $ echo $DATA_DIR
    (open-webui) $ pip install -U open-webui
    ・「gemma4:e4b」モデルをインストールする
     ターミナルから次のコマンドを実行する
    ollama pull gemma4:e4b

  2. 「Gemini」でシステムプロンプトを作成する

    オフィシャルサイト のシステムプロンプトをテキストファイルにする
      → fileHiDream_system_prompt.txt

    ②「Gemini」でこのファイルから OpenWebUI 用のシステムプロンプトを作成する
    このテキストファイルは HiDream-Image O1 のプロンプト・エンハンサーのシステムプロンプトです。これと同じ機能を Open WebUI で実現しようと思います。システムプロンプトを英語で作成してください。日本語訳もお願いします(テキストファイル添付)
    〇 JSON フォーマットのプロンプト作成
    出力をJSONではなく、ピュアテキストにしてください
    〇 システムプロンプト
    「」で囲まれた日本語テキストが英語に翻訳されてしまいます。日本語のままにするには?
    〇 強化版システムプロンプト
    この強化版システムプロンプトの全文を日本語でお願いします
    〇 日本語強化版システムプロンプト
    ③ 最終的に作成されたピュアテキスト(強化版)をシステムプロンプトとして利用する
    ▼ Gemini が作成したシステムプロンプト(JSON):英語 / AIによる日本語訳
    ▼ Gemini が作成したシステムプロンプト(TEXT):英語 / AIによる日本語訳
    ▼ Gemini が作成したシステムプロンプト(強化版):英語 / AIによる日本語訳

  3. 「OpenWebUI」を起動して http://localhost:8080 を開く

    ①「ワークスペース」を選択
    ②「新規作成」を押す

  4. 新しくモデルを登録する

    ③ モデル名を「HiDream-O1」とする
    ④ ベースモデルに「gemma4:e4b」を選択する
    ⑤ システムプロンプトを入力する
     「gemini」が出力したシステムプロンプト(日本語)をそのまま使用する
    ⑥「保存して作成」を押す

    ⑦ このモデルを利用して HiDream-O1 のプロンプトを作成する






















    ⑧ できたプロンプトを HiDream-O1 プロンプト・エンハンサーなしのワークフローで画像を生成する

  5. プロンプト生成のテスト
    ・入力プロンプト
    若い日本人女性モデルのポートレート
    ・「OpenWebUI」HiDream-O1 モデルの出力ログ
    [IMAGE PROMPT]
    A cinematic medium close-up portrait of a young Japanese female model. She possesses elegant, serene features with large, thoughtful eyes and soft, natural makeup. Her expression is contemplative, making direct eye contact with the viewer. She is wearing a simple, tailored cream-colored top that subtly catches the light. The composition utilizes a shallow depth of field (bokeh) to keep the focus intensely on her face, while the background is an abstract blend of warm beige and soft muted greens, suggesting a minimalist architectural interior during golden hour. Shot with an 85mm prime lens at eye level, utilizing soft diffused natural window light that casts subtle shadows and highlights her skin's texture beautifully. The overall aesthetic should be high-fashion editorial photography, rendered in the style of Annie Leibovitz or Peter Lindbergh: highly detailed, emotionally resonant, and photorealistic.

    ---
    [REASONING]
    ユーザーからのリクエストは「若い日本人女性モデルのポートレート」という非常に抽象的なものです。プロンプトエンジニアリングスペシャリストとして、これを単なる人物描写ではなく、「何を」「どのような雰囲気で」「どんな技術的視点から」撮影したのかという詳細なディレクションに昇華させる必要があります。
    1. **主体(Subject)の具体化:** 「若い日本人女性モデル」を、具体的な美しさの要素(「穏やかで思慮深い目」「エレガントな特徴」)や服装(「シンプルで洗練されたクリーム色のトップス」)に落とし込みました。
    2. **構図・動作(Composition/Action)の確定:** ポートレートであることを強調し、「ミディアムクローズアップ」を採用しました。視線は鑑賞者に向けることで、写真的なインタラクションを生み出します。
    3. **場所と照明(Location/Lighting):** 抽象的な背景を回避するため、「ミニマリストな建築インテリア」という具体的なロケーションを設定し、時間帯を「ゴールデンアワーの自然光」に固定しました。これにより、ドラマチックかつ優美なライティングが保証されます。
    4. **スタイルと仕様(Image style/Specs):** 「ポートレート」特有の専門用語(85mm prime lens, shallow depth of field, bokeh)を導入し、プロフェッショナルで高い技術水準のアウトプットを目指します。さらに、参照すべき写真家名(Annie LeibovitzやPeter Lindberghなど)を挙げることで、全体的なトーン&マナーを規定しました。

    ---
    [RESOLVED KNOWLEDGE]
    none
    ・HiDream-O1 で画像生成
    7110_hidream_o1_dev_t2i.json 1728x2304
    7110_2026-06-07_00002_m.jpg A cinematic medium close-up portrait of a young Japanese female model. She possesses elegant, serene features with large, thoughtful eyes and soft, natural makeup. Her expression is contemplative, making direct eye contact with the viewer. She is wearing a simple, tailored cream-colored top that subtly catches the light. The composition utilizes a shallow depth of field (bokeh) to keep the focus intensely on her face, while the background is an abstract blend of warm beige and soft muted greens, suggesting a minimalist architectural interior during golden hour. Shot with an 85mm prime lens at eye level, utilizing soft diffused natural window light that casts subtle shadows and highlights her skin's texture beautifully. The overall aesthetic should be high-fashion editorial photography, rendered in the style of Annie Leibovitz or Peter Lindbergh: highly detailed, emotionally resonant, and photorealistic.
    若い日本人女性モデルを、映画のようなミディアムクローズアップで撮影したポートレート。彼女は、優雅で穏やかな顔立ちに、大きく思慮深い瞳、そしてソフトでナチュラルなメイクを施している。彼女の表情は物思いにふけり、鑑賞者と直接視線を交わしている。彼女は、光をさりげなく捉える、シンプルな仕立てのクリーム色のトップスを着用している。構図は、浅い被写界深度(ボケ)を利用して彼女の顔に焦点を合わせ、背景は温かみのあるベージュと柔らかな落ち着いたグリーンの抽象的なブレンドで、ゴールデンアワーのミニマルな建築のインテリアを連想させる。85mm単焦点レンズを使用し、目線の高さで撮影。柔らかな拡散光による自然光が、繊細な影を作り出し、彼女の肌の質感を美しく際立たせている。全体的な美学は、アニー・リーボヴィッツやピーター・リンドバーグのような、非常にディテールに富み、感情に訴えかけ、フォトリアリスティックなハイファッションのエディトリアル写真となるべきである。

  6. OpenWebUI で作成したシステムプロンプトでの生成例
     7110_hidream_o1_dev_t2i.json(プロンプト・エンハンサーなし)のワークフローを使用して作成したプロンプトで生成する
    ① クローズアップポートレート 2304x1728
    7110_2026-06-03_00006_m.jpg20代の若い女性のクローズアップポートレート。ナチュラルメイク、柔らかな表情。
    85mmレンズ、f/1.4、浅い被写界深度、背景のボケ。
    左から差し込む柔らかな窓の光、ゴールデンアワーの輝き、温かみのある肌色。
    映画のような、リアルな、細部までこだわった、プロフェッショナルな写真。
    注意点:彩度過度、アニメ調、低解像度、歪んだ顔。
    A breathtaking, cinematic close-up portrait of a young woman in her early twenties, exuding a natural, gentle, and soft expression. She is perfectly lit by soft, diffused natural light streaming in from the left side, capturing the warm, golden glow of the late afternoon (Golden Hour). Her makeup is minimal and enhancing, accentuating her natural beauty and warm skin tones. The composition uses an 85mm lens at an aperture of f/1.4, creating an extreme shallow depth of field (bokeh) that beautifully blurs the background into soft, painterly circles of light. The focus must be razor-sharp on her eyes and facial features, emphasizing highly detailed skin texture and the subtle contours of her face. The overall aesthetic should be hyper-realistic, professional fine art photography, capturing the warm, diffused quality of light, while strictly avoiding oversaturation, anime styling, low resolution, or any facial distortion.
    ▼ ① LLM の回答 / プロンプトの日本語訳

    ② 文字の入ったカタログ 1728x2304
    7110_2026-06-03_00004_m.jpgミニマルなワイヤレスイヤホンの、高級感あふれるバイリンガル(日本語+英語)ポスター広告です。
    マットブラックの表面に、プレミアムスタジオ照明、金属エッジの柔らかなハイライト、深くコントロールされた陰影、そして完璧な色彩精度で製品を映し出します。
    テクスチャは洗練され、触感があり、微細なディテールまで鮮明で、高級感のある商業的な仕上がりを実現します。
    ポスターは、エレガントでハイファッションな美学に基づき、十分なネガティブスペース、バランスの取れた構成、そして最小限の視覚的ノイズでデザインします。
    洗練されたモノクロパレットに、さりげないゴールドまたはシルバーのアクセントを加え、高級感を強調します。
    簡潔な英語の見出し「Pure Sound. Perfect Silence.」を記載します。
    洗練されたタイポグラフィで日本語の見出し「純粋な音・静寂の極み」を追加します。
    その下に、小さなバイリンガルのタグライン「Wireless Crafted Quality・職人技が宿る仕上り」を配置します。
    テキストは、製品から気を散らすことなく、デザインに自然に溶け込むようにしてください。
    背景は、高級感のある滑らかなグラデーションのチャコールブラックにしてください。
    中央配置、縦長の3:4アスペクト比、ロゴや透かしは使用しないでください
    A highly sophisticated, minimalist commercial studio poster advertising premium wireless earphones. The main subject, the wireless earphones, are rendered in matte black, showcased centrally, appearing to float against a smooth, deep charcoal gradient background. The design emphasizes extreme negative space and high-fashion elegance. The lighting is dramatic and precise: a premium studio setup utilizing soft, diffused key lights to highlight the metallic edges with subtle, controlled silver or gold accents, creating deep, rich shadows and perfect specular reflections on the matte black surfaces. The texture must appear exquisitely tactile, with sharp focus on every microscopic detail, conveying top-tier commercial quality. The composition follows a vertical 3:4 aspect ratio, maintaining perfect balance. The typography is clean, modern, and integrated seamlessly into the design. At the upper third, the English headline reads, "Pure Sound. Perfect Silence." In a refined, elegant Japanese calligraphy style, directly below the English, the main headline reads "純粋な音・静寂の極み". Finally, positioned subtly near the bottom edge, the smaller bilingual tagline is displayed: "Wireless Crafted Quality・職人技が宿る仕上り". The typography should use a sophisticated, thin sans-serif font, colored in a muted, brushed silver, ensuring it enhances the luxury feel without drawing focus from the product. Shot with an 85mm prime lens, extremely shallow depth of field, soft cinematic gradient, high dynamic range, hyper-detailed.
    ▼ ② LLM の回答 / プロンプトの日本語訳

    ③ ドリップコーヒー 2304x1728
    7110_2026-06-03_00003_m.jpgコンテストレベルの技術を持つサードウェーブの日本人バリスタによる、ドリップコーヒーの超詳細な断面クローズアップ、コーヒー粉に同心円状の波紋を描く完璧な注ぎ口、96℃のお湯から抽出までの正確な温度勾配の視覚化、細胞構造が目に見える個々のコーヒー粉、ボリュームのある照明で照らされた蒸気、木目模様が見えるヒノキ材のカウンターを備えた日本のミニマリストコーヒーバーのセッティング、東向きの窓から正確に32度の角度で差し込む朝日、磨かれた真鍮製の器具への反射、Canon EOS R3とCanon RF 100mm F2.8 L MACRO IS USM(f/4)で撮影、16ビットの色深度、45の個別フレームにわたるフォーカススタック、本物のコーヒーショップの環境音の視覚化、クレマの微細な泡、液体物理学の科学的正確さ、黄金比抽出ポイントでの正確なタイミング、アルバート・ワトソンの照明とアーヴィング・ペンの構図、感情的なつながりを伴う完璧な技術的
    An extremely hyper-realistic, cinematic macro photograph capturing the peak moment of a high-level drip coffee extraction process, executed by a Japanese third-wave barista, conveying a sense of technical perfection blended with artistic passion. The composition focuses tightly on the coffee grounds within the dripper, where a perfectly formed, concentric ripple pattern is being drawn by the stream of water—the heart of the action. The scene is set in a minimalist Japanese coffee bar featuring a visible, textured Hinoki wood counter. Intense, volumetric morning sunlight streams in at a precise 32-degree angle from a window facing east, creating strong highlights and deep shadows. The subject coffee grounds must be rendered with visible cellular structures, showing the scientific precision of the liquid physics. The water itself is visually rendered to demonstrate the temperature gradient, starting from 96°C. The macro shot must capture the delicate, micro-foamed crema forming at the surface, emphasizing the scientific accuracy and the golden ratio extraction point timing. Reflections on highly polished brass brewing tools are critical. The entire image should possess the dramatic, controlled lighting of Albert Watson, combined with the masterful composition of Irving Penn. Shot with a Canon EOS R3 and a Canon RF 100mm F2.8 L MACRO IS USM at f/4, requiring a 45-frame focus stack, deep depth of field for extreme detail, 16-bit color depth, and a tangible sense of motion frozen in time.
    ▼ ③ LLM の回答 / プロンプトの日本語訳

    ④ コマーシャル商品写真(化粧品) 2048x2048
    7110_2026-06-03_00005_m.jpg「L'Eau de HiDream」という高級バナナの香りの香水瓶のプロフェッショナルな製品写真。ボトルは金色の色合いのガラス製で、白い大理石のテーブルの上に置かれている。その横には、「L'Eau de HiDream」というテキストがセリフ体の金箔フォントでエレガントに印刷されたスタイリッシュな黄色い箱がある。柔らかなスタジオ照明、浅い被写界深度、ブランド名に鋭い焦点、リアルな質感、4k品質。
    A hyper-detailed, luxurious product photograph of a perfume bottle, named "L'Eau de HiDream," displayed on a pristine white marble surface. The composition is minimalist, focusing entirely on the elegance and craftsmanship of the bottle. The perfume bottle should have a distinct, subtle tropical gold accent, evoking the rich essence of the fragrance.

    The accompanying packaging is a rigid, premium box in a creamy off-white or champagne hue. On the visible surface of the box, the brand name "L'Eau de HiDream" must be rendered in highly reflective, embossed gold foil lettering.

    Key Details:

    Lighting: Utilize soft, dramatic studio lighting (softbox diffusion) that creates gentle specular highlights on the glass and metallic accents, emphasizing depth and luxury.
    Texture & Material: Extreme attention to detail on the glass texture, the marble reflection, and the embossed foil quality.
    Vibe: High-end, luxurious, sophisticated, and ethereal.
    Camera/Style: Shot with a macro lens, f/2.8 aperture, shallow depth of field (bokeh effect) to isolate the product.
    (Negative prompts: cartoon, illustration, amateur, blurry, dull colors)
    ▼ ④ LLM の回答 / プロンプトの日本語訳

    ⑤ コマーシャル商品写真(コーヒー) 2048x2048
    7110_2026-06-04_00001_m.jpgマットブラックのコーヒーバッグを素朴な木製のテーブルに置いた、プロフェッショナルなコマーシャル商品写真。パッケージには金色のラベルが貼られ、エレガントなセリフフォントで「MORNING BREW」とはっきりと書かれ、その下に小さく「100% ARABICA」と書かれています。バッグの横には、淹れたてのコーヒーが入った白い陶器のカップが置かれ、湯気が立ち上っています。周囲には焙煎されたコーヒー豆が散らばっています。温かい朝の陽光、ドラマチックな影、高コントラスト、4K広告品質。
    A highly detailed, professional commercial product photograph capturing a rich, cozy morning coffee ritual. The main focus is on a matte black coffee bag resting on a rustic, distressed wooden table surface. Affixed to the front of the bag is an elegant golden label that prominently displays the text "MORNING BREW" in a classic serif font, with smaller supporting text underneath reading "100% ARABICA". Positioned immediately next to the bag is a clean white porcelain cup filled with freshly brewed coffee, from which soft wisps of steam gently rise. Scattered across the table surface around the core items are several perfectly roasted, dark brown coffee beans, adding texture and depth. The scene must be illuminated by warm, directional golden hour sunlight streaming in from the side (sidelighting), creating dramatic, pronounced shadows and high contrast that emphasize the matte finish of the bag and the steam. Use a low-angle shot with an 85mm lens and shallow depth of field to keep the focus sharp only on the coffee bag and cup while softly blurring the background bokeh. Ultra photo-realistic, cinematic commercial quality, 4K advertising resolution, deep saturation, warm color palette.
    ▼ ⑤ LLM の回答 / プロンプトの日本語訳

ComfyUI ワークフローの プロンプト・エンハンサー検証

 SubGraph のシステムプロンプトを前記の 日本語強化版(JSON)の内容に変更する → 7100v2_hidream_o1_agent_dev
  1. システムプロンプトを変更する
    <|turn>system
     システムプロンプト本文
    <|turn|>
    ▼ オリジナルのシステムプロンプト 中国語(簡体)
       ↓ ↓ ↓
    ▼ 日本語強化版システムプロンプト(JSON)
    ▼ (参考)英語強化版システムプロンプト(JSON)

  2. プロンプト・エンハンサーのオリジナル版との比較
    ・プロンプトは同じ日本語プロンプト → 英語のプロンプトとの違い
    中国語(簡体)「7100_hidream_o1_agent_dev.json」日本語強化版 「7100v2_hidream_o1_agent_dev.json」
    雑誌の表紙 1728x2304
    7100_2026-06-01_00006_m.jpg 7100_2026-06-05_00003_m.jpg
    ① 文字の入ったカタログ 1728x2304
    7100_2026-06-01_00010_m.jpg 7100_2026-06-05_00013_m.jpg
    ② クローズアップポートレート 2304x1728
    7100_2026-06-01_00012_m.jpg 7100_2026-06-05_00017_m.jpg
    ③ コマーシャル商品写真(コーヒー) 2048x2048
    7100_2026-06-01_00014_m.jpg 7100_2026-06-05_00010_m.jpg
    ④ コマーシャル商品写真(化粧品) 2048x2048
    7100_2026-06-01_00016_m.jpg 7100_2026-06-05_00009_m.jpg
    ⑤ ファッション誌のモデル写真 1728x2304
    7100_2026-06-01_00018_m.jpg 7100_2026-06-05_00014_m.jpg
    7100_2026-06-01_00020_m.jpg 7100_2026-06-05_00015_m.jpg
    7100_2026-06-01_00022_m.jpg 7100_2026-06-05_00016_m.jpg
    ⑥ ドリップコーヒー 2304x1728
    7100_2026-06-01_00024_m.jpg 7100_2026-06-05_00011_m.jpg

  3. プロンプト・エンハンサーのオリジナル版 との比較(うまくできないものの再挑戦)
    ・プロンプトは同じ日本語プロンプト → 英語のプロンプトとの違い
    中国語(簡体)「7100_hidream_o1_agent_dev.json」日本語強化版 「7100v2_hidream_o1_agent_dev.json」
    手書き看板 2304x1728
    7100_2026-06-02_00016_m.jpg 7100_2026-06-05_00007_m.jpg
    コーヒーガイド 2304x1728
    7100_2026-06-02_00038_m.jpg 7100v2_2026-06-06_00001_m.jpg
    コミックの1ページ 1728x2304
    7100_2026-06-02_00043_m.jpg 7100_2026-06-05_00004_m.jpg
    教育用チラシ 2304x1728
    7100_2026-06-02_00045_m.jpg 7100_2026-06-05_00019_m.jpg
    日本のポスター 1728x2304
    7100_2026-06-02_00049_m.jpg 7100_2026-06-05_00005_m.jpg

「プロンプト・エンハンサー」検証結果から

  1. プロンプト・エンハンサーを使うと日本語プロンプトを英語とほぼ同じように扱うことができる → Step 4:プロンプト・エンハンサーと日本語対応
  2. ComfyUI 標準ワークフローに実装されたプロンプト・エンハンサーは実行に時間がかかるが効果は大きい
  3. 外部 LLM(OpenWebUI など)を利用することで同様の結果を得ることもできる(この場合実行速度は速いが生成結果を得るまでに手間がかかる)
  4. オリジナルのプロンプト・エンハンサーは中国語(簡体)で書かれているが 日本語・英語 でも同様の結果を得ることができる(わかりやすいので日本語を採用)
  5. プロンプト・エンハンサーを通すと表示すべき「テキスト」も含めて英訳されてしまうことがある(対応したが完全ではない)
  6. 「Hi-Dream-O1」モデルの日本語理解力はやや低いと思われるのでプロンプトは英語入力か日本語の場合はプロンプト・エンハンサーを通す
  7. 「Hi-Dream-O1」モデルの日本語テキスト描画能力は「ERNIE-Image」に比較するとやや落ちる(特にかな文字に弱い)
    システムプロンプトの言語による生成結果の違い ワークフロー 7100_hidream_o1_agent_dev.json
    中国語 (オリジナル)英語 JSON日本語 JSON日本語強化版 JSON
    7100_2026-06-06_00004_m.jpg 7100_2026-06-06_00002_m.jpg 7100_2026-06-06_00004_m.jpg 7100v2_2026-06-06_00005_m.jpg
     Prompt:
    ドリップコーヒーガイドをテーマにした、縦長のミニマルなピクトグラムポスター。背景は均一な清潔なオフホワイト。デザインはフラットなベクタースタイルを採用し、濃茶色の太い輪郭線で描かれた非常に簡略化されたピクトグラムアイコンと温かみのあるオレンジ色のアクセントカラーブロックで構成され、グラデーションや3Dシャドウ効果はなく、公共の標識のように直感的で読みやすいビジュアル言語となっている。画像の上部中央には、濃茶色の太字サンセリフの大きなタイトルテキスト「ハンドドリップコーヒーガイド」がある。タイトルの下には、4つのステップブロックが垂直の中央軸に沿って均等に配置され、各ブロックには大きなシンボルアイコンとそれに付随するテキストが含まれている。最初のブロック:左側にはミニマルな手回しコーヒーグラインダーのグラフィックがあり、右側には2行のテキストがある。1行目は太字のオレンジで「STEP 1」、2行目は濃茶色で「コーヒー豆20gを挽く」と書かれている。2番目のブロック:左側には、円形の温度計ダイヤルが付いた細い首のドリップケトルのグラフィックがある。右側の文字はオレンジ色の「STEP 2」とダークブラウンの「お湯を92℃まで沸騰かす」です。 3 番目のブロック: 左側は、V 字型フィルター ドリッパーに水を注ぐケトルの注ぎ口を描いたダイナミックなグラフィックで、ドリッパーの上の蒸気を表す 3 本の波線があります。右側の文字はオレンジ色の「STEP 3」、ダークブラウンの「40gのお湯を注ぎ、30秒待ち」となります。 4 番目のブロック: 左側は、縁から蒸気の線が立ち上る丸いコーヒー マグのグラフィックです。右側の文字にはオレンジ色の「STEP 4」とダークブラウンの「残りのお湯を注いで楽しむ」と書かれています。画像の一番下には、視覚的なクロージャーとして機能する水平の濃い茶色の細い破線があり、その下には中央に「毎日のコーヒーをお楽しみください」という小さな装飾テキストが表示されています。全体的な構成は明確な情報階層と厳密に整合しており、垂直アスペクト比に完全に適合しています。

生成データ詳細

 

更新履歴

 

参考資料