AI Library
自律的科学発見の時代
キム・ギョンジン, 弁護士
AI科学者とセルフドライビング・ラボ
AI科学者とセルフドライビング・ラボが、科学研究における主張の生成と検証をどのように変えつつあるのかを追います。文献に基づく発見、自然言語プロトコルからロボット命令への変換、マルチエージェント研究システム、閉ループ実験室、材料探索、検証ギャップ、証拠の連鎖、研究ハーネス、学術誌倫理、法的責任までを扱います。
AIライブラリ
デジタル主権の二重構造
欧州の脱パランティアとアメリカン・ビッグテックの鎖
金景珍(キム・ギョンジン), 弁護士
欧州の情報機関と国防省が米パランティアの分析ツールを排除し始めた2026年の記録です。フランス国内治安総局とドイツ連邦憲法擁護庁、オランダ国防省の置き換え決定、米国の輸出規制が同盟国の人工知能アクセスをわずか3日で遮断した事件、CLOUD ActとFISA 702条がもたらした域外管轄の実態を扱っています。欧州連合のクラウド・AI開発法(CADA)が定めた4段階の主権保証レベルと主権理由による契約解除権、ユーロスタック構想と3,000億ユーロの投資障壁に至るまで、全5章15節と結論2節で整理しました。
[AI書斎] 第17章 ComfyUIワークフロー自動化
Nano Banana Pro実践プロンプトブック
第5部 高度な技法と自動化
第17章 ComfyUIワークフロー自動化
キム・ギョンジン
100枚の画像を一括スタイル変換
絵を1枚描くときは、筆を持って色を塗れば済みます。しかし、100枚のスケッチに同じ絵の具で色を塗らなければならないとしたら、どうすればいいでしょうか。1枚ずつ作業すると時間がかかり、退屈です。そんな時に必要なツールが「ComfyUI(コンフィUI)」です。ComfyUIは工場の組み立てラインのように、画像作成のプロセスを自動化してくれるプログラムです。
ComfyUIは「ノード(Node)」と呼ばれる小さなボックスを線でつなぐ方式で作動します。レゴブロックを組み立てるのと似ています。「画像読み込み」ボックスと「Nano Banana Pro」ボックス、「画像保存」ボックスを順番につなぎます。すると、コンピューターが自動的に100枚の写真を次々と処理します。
Nano Banana ProモデルをComfyUIに接続する方法は2つあります。1つ目は、ComfyUIパートナーノードを使用する方法です。2025年8月に公開されたこの機能は、ComfyUIの画面で「Google Gemini Image」ノードを検索して追加するだけです。2つ目は、ComfyUI-Gemini-APIという拡張機能をインストールする方法です。この方式はAPIキーを直接管理する必要がありますが、より詳細な設定が可能です。
一括処理の核心は「Load Image Batch」ノードです。このノードは指定したフォルダから画像を自動的に読み込みます。ComfyUIの「Auto Queue」機能をオンにすると、1枚が終わるやすぐに次の枚が自動的に開始されます。私たちが寝ていたり他の仕事をしていたりする間に、コンピューターが100枚すべてを処理してくれます。
この方式はショッピングモールを運営している人に役立ちます。服を着たモデルの写真100枚の背景をすべて「パリのエッフェル塔の前」に変えたい場合、一度設定して実行ボタンを押すだけです。2025年時点で、ComfyUIを使用するプロのクリエイターは、1日に数百枚の画像を自動生成しています。手作業では1時間あたり20〜30枚が限界ですが、自動化を活用すれば10倍以上の結果を得ることができます。
[スタイル一括変換のためのプロンプト例]
事例A:スケッチを油絵スタイルに変換する
入力設定
Batch Size: 100(フォルダ内の全画像)
Input Directory: ./my_photos/sketches
Model: Gemini Image (Nano Banana Pro)
Auto Queue: 有効化
プロンプト Transform the uploaded sketch into a high-quality oil painting in the style of Vincent van Gogh. Use thick, swirling brushstrokes and a vibrant color palette dominated by deep blues and bright yellows. Maintain the original composition and subject of the sketch but reinterpret the textures to look like oil on canvas. Ensure the lighting is dramatic and atmospheric.
日本語訳:アップロードされたスケッチを、フィンセント・ファン・ゴッホ風の高品質な油絵に変換して。厚塗りで渦巻くような筆致と、濃い青や明るい黄色を主とした鮮やかな色彩を使って。スケッチの元の構図と主題は維持しつつ、質感はキャンバス上の油彩のように表現して。照明はドラマチックで雰囲気のあるものにして。
事例B:製品写真をイラストスタイルに変換する
プロンプト Convert this product photo into a clean, modern illustration style. Use flat colors with minimal gradients. Add subtle shadows to give depth. Keep the product's shape and proportions exactly the same. Background should be pure white. Style similar to Apple product illustrations.
日本語訳:この製品写真を清潔感のある現代的なイラストスタイルに変換して。グラデーションを最小限に抑えたフラットな色使いにして。奥行きを出すために、控えめな影を追加して。製品の形状と比率は正確に維持して。背景は真っ白に。Appleの製品イラストに近いスタイルにして。
事例C:日常の写真をアニメスタイルに変換する
プロンプト Transform this photo into Studio Ghibli anime style. Soft, painterly backgrounds with detailed foreground subjects. Use warm, nostalgic color palette. Characters should have large expressive eyes. Maintain the original pose and composition. Add subtle atmospheric effects like soft light rays.
日本語訳:この写真をスタジオジブリのアニメスタイルに変換して。柔らかく絵画のような背景と、詳細な前景の被被写体を表現して。暖かくノスタルジックなカラーパレットを使って。キャラクターは大きくて表情豊かな瞳にして。元のポーズと構図は維持して。柔らかな光の筋のような、控えめな雰囲気の効果を追加して。
2. キャラクター一貫性パイプラインの構築
漫画や映画を作るときに最も重要なのは、主人公の顔がシーンごとに変わらないことです。しかし、人工知能は新しく絵を描くたびに、少しずつ異なる顔を作り出してしまう習性があります。この問題を解決するために、ComfyUIで「キャラクター一貫性パイプライン」을 構築します。これは人工知能に「このキャラクターの容姿を絶対に忘れないで」と約束させるプロセスです。
Nano Banana Proは最大14枚までの画像を参照して、キャラクターの特徴を記憶することができます。ComfyUIではこの機能をより精巧に制御します。「キャラクター参照(Character Reference)」ノードを作成し、そこに主人公の正面写真、側面写真、さまざまな表情の写真を入れておきます。このノードを画像生成ノードに接続します。すると、Nano Banana Proは新しいシーンを描くたびに、参照ノードにある顔データを確認しながら絵を描きます。
2025년 1월にアップデートされたFluxベースのキャラクター一貫性ワークフローは、全世界のクリエイターから絶賛されました。ThinkDiffusionで公開されたこのワークフローは、ポーズシートファイルを活用して、さまざまな角度でも同一のキャラクターを維持します。核心は、Random Noise設定を固定(Fixed)にしておくことです。こうすることで、フェイスディテーラーが作動する際の一貫性が維持されます。
パイプラインの構築が終われば、私たちは状況と行動だけを言葉で説明すればよくなります。「主人公がカフェでコーヒーを飲んでいる」、「主人公が雨の中を走っている」と入力します。人工知能は、私たちが設定しておいた主人公の顔と服装をそのまま維持したまま、背景と動作だけを変更します。これは仮想の俳優を雇って映画を撮影するようなものです。
顔だけでなく、衣装や小道具の一貫性も維持できます。主人公がいつも持ち歩いているバッグがあれば、バッグの写真を別途の参照ノードに入れておきます。Nano Banana Proは人物と物の特徴をそれぞれ分析し、一つのシーンとして自然に合成します。
[キャラクター一貫性維持のためのプロンプト例]
事例A:さまざまなシーンで同一のキャラクターを維持する
参照画像の設定
Image 1:主人公の正面クローズアップ写真
Image 2:主人公の45度角の全身写真
Image 3:主人公の側面上半身写真
Image 4:主人公の衣装の詳細写真
シーン 1 プロンプト:カフェでコーヒーを飲む Generate a scene featuring the character from the reference images. The character is sitting at a cozy cafe table, holding a white ceramic coffee cup with both hands. Maintain the character's facial features, hairstyle (short bob with ash gray color), and outfit (beige trench coat and blue jeans) exactly as shown in the references. The lighting should be warm indoor lighting from a window on the left side. The expression should be relaxed and contemplative, looking slightly down at the coffee cup. Camera angle: medium shot from slightly above.
日本語訳:参照画像のキャラクターが登場するシーンを生成してください。キャラクターは居心地の良いカフェのテーブルに座り、両手で白いセラミックのコーヒーカップを持っています。キャラクターの顔立ち、ヘアスタイル(アッシュグレーのショートボブ)、衣装(ベージュのトレンチコートとジーンズ)を参照画像に示されている通りに正確に維持してください。照明は左側の窓から差し込む温かみのある室内照明にします。表情はリラックスして思索にふけっており、コーヒーカップを少し見下ろしています。カメラアングル:少し上からのミディアムショット。
シーン 2 プロンプト:雨の中を走る
Generate a scene featuring the same character from the reference images. The character is running through heavy rain on a city street at night. Keep all facial features, hairstyle, and clothing identical to references. The trench coat is now wet and slightly darker. Hair is wet and sticking to forehead. Expression shows determination and urgency. Rain drops are visible. Street lights create reflections on wet pavement. Motion blur on background. Camera angle: dynamic side view with slight low angle.
日本語訳:参照画像と同じキャラクターが登場するシーンを生成してください。キャラクターは夜の街路で、激しい雨の中を走っています。すべての顔立ち、ヘアスタイル、衣装を参照画像と同一に維持してください。トレンチコートは濡れて色が少し暗くなっています。髪は濡れて額に張り付いています。表情は決然とした様子と切迫感を見せてください。雨粒が見えるようにし、街灯が濡れた舗装道路に反射を作っているようにします。背景にはモーションブラー効果。カメラアングル:少し低い角度からのダイナミックなサイドビュー。
事例 B:ウェブトゥーン用6コマ連続画像の生成
キャラクター設定 Main character: Young woman, age 25, round face, big brown eyes, long black straight hair with bangs, wearing a yellow hoodie and black leggings. Cheerful personality. Art style: Clean Korean webtoon style with bold outlines and soft shading.
1コマ目プロンプト Panel 1: The character wakes up in bed, hair messy, eyes half closed, looking at alarm clock showing 9:00 AM. Speech bubble space on top right. Shocked expression starting to form. Bedroom background with morning sunlight through curtains. Vertical webtoon panel format.
2コマ目プロンプト Panel 2: The character jumps out of bed in panic. Dynamic pose with arms flailing. Hair flying. Same yellow hoodie now wrinkled from sleep. Motion lines around the figure. Expression: wide eyes, mouth open in shock. Same bedroom background. Vertical webtoon panel format.
3. 多言語カードニュースの同時生成
グローバル時代に合わせて、韓国語だけでなく英語、日本語、中国語のコンテンツを同時に作成しなければならない時があります。ナノ・バナナ・プロは優れたテキストレンダリング能力を備えており、画像の中に文字を正確に書き込むことができます。ComfyUIを活用すれば、一つのデザインで複数の言語バージョンを同時に作成する自動化システムを構築できます。
ComfyUIの画面に3つのパスを作成します。1つ目のパスは韓国語、2つ目は英語、3つ目は日本語です。デザインの基本となる背景画像や製品写真を共通で接続します。各パスには異なる言語に翻訳されたテキストプロンプトを入力します。
実行ボタンを押すと、ナノ・バナナ・プロは3つのバージョンの画像を同時に生成します。単に文字が変わるだけではありません。各言語のフォントデザインと配置が背景に合うように自動的に調整されます。韓国語はゴシック体でスッキリと、英語はサンセリフで洗練された印象に、日本語は明朝体で格調高く表現されます。
このシステムはマーケターやコンテンツクリエイターの時間を画期的に節約してくれます。Photoshopで文字を一つずつ修正する必要はなく、テキストリストさえ準備されていれば、数十カ国の言語のカードニュースを一瞬で作り出すことができます。元の画像の雰囲気や照明をそのまま維持しながら、テキストだけを自然に置き換えるインペインティング機能を活用すれば、最初からその言語でデザインされたポスターのような自然な結果が得られます。
[多言語カードニュース同時生成のためのプロンプト例]
事例 A:飲料広告ポスターの多言語バージョン
共通背景設定 Scene: A refreshing glass of orange juice on a rustic wooden table. Fresh orange slices arranged around the glass. Morning sunlight streaming from the right side creates warm highlights. Water droplets on the glass surface. Clean, minimalist composition with space for text in the upper portion.
韓国語ノードプロンプト Create a promotional poster with the provided background. In the upper center area, write the text '상큼한 하루의 시작' in a bold, modern Korean sans-serif font (similar to Noto Sans KR Bold). Text color should be dark orange (#FF6B00) with a subtle white drop shadow for readability. Below the main text, add smaller text '100% 생과일 주스' in the same font family but lighter weight. Ensure all Korean characters are spelled correctly with proper spacing. The text should feel fresh and energetic, matching the juice imagery.
英語ノードプロンプト Create a promotional poster with the same background. In the upper center area, write the text 'Start Your Day Fresh' in a stylish sans-serif font (similar to Montserrat Bold). Text color should be dark orange (#FF6B00) with a subtle white drop shadow. Below the main text, add smaller text '100% Fresh Squeezed' in the same font family but lighter weight. The typography should feel modern, clean, and appetizing. Ensure proper kerning and letter spacing.
日本語ノードプロンプト Create a promotional poster with the same background. In the upper center area, write the text 'フレッシュな一日を' in an elegant Japanese font (similar to Noto Sans JP Bold). Text color should be dark orange (#FF6B00) with a subtle white drop shadow. Below the main text, add smaller text '100%生搾りジュース' in the same font family but lighter weight. Ensure all Japanese characters including kanji and katakana are rendered correctly. The typography should convey freshness and quality.
事例 B:Instagram 6枚カードニュースシリーズ
シリーズ共通設定 Instagram card news series, 4:5 vertical aspect ratio. Consistent design system: gradient background from soft peach (#FFE5D9) to cream (#FFF8F0). Rounded rectangle text boxes with white fill and subtle shadow. Icon illustrations in line art style. Page number indicator at bottom.
1ページ目韓国語プロンプト Card news page 1 of 6. Title text at top: 'AI 이미지 생성' in bold black Korean font, large size. Subtitle: '초보자를 위한 완벽 가이드' in medium gray. Center of page: simple line art illustration of a robot holding a paintbrush. Page indicator shows '1/6' at bottom. Clean, educational look. All Korean text must be perfectly spelled.
1ページ目の英語プロンプト Card news page 1 of 6. Title text at top: 'AI Image Generation' in bold black sans-serif font, large size. Subtitle: 'Complete Guide for Beginners' in medium gray. Center of page: simple line art illustration of a robot holding a paintbrush. Page indicator shows '1/6' at bottom. Clean, educational look. Professional typography with proper spacing.
事例C:eコマースバナー多言語バージョン
製品背景設定 E-commerce banner, 1200x628 pixels (Facebook ad ratio). White background. Premium wireless earbuds product photo on the right side (60% of frame). Left side reserved for text and promotional information. Subtle gradient shadow under the product. Modern, tech-focused aesthetic.
韓国語バナープロンプト Create an e-commerce banner with the product setup described. On the left side, display: Main headline '음악의 새로운 차원' in bold Korean sans-serif font, size appropriate for banner. Subheadline '프리미엄 무선 이어버드' in smaller font below. Price tag styled element showing '₩199,000' with strikethrough, and '₩149,000' in red below it. Small badge saying '25% 할인' in a red rounded rectangle. Call-to-action button shape with text '지금 구매하기'. All Korean text must be accurate and professionally laid out.
英語バナープロンプト Create an e-commerce banner with the product setup described. On the left side, display: Main headline 'A New Dimension of Sound' in bold sans-serif font, size appropriate for banner. Subheadline 'Premium Wireless Earbuds' in smaller font below. Price tag styled element showing '$199' with strikethrough, and '$149' in red below it. Small badge saying '25% OFF' in a red rounded rectangle. Call-to-action button shape with text 'Shop Now'. Professional e-commerce typography standards.
4. 顔補正・解像度復元の自動化
私たちが撮影した写真の中には、表情は気に入っているものの画質が良くなかったり、ピントが少しずれていたりするものがあります。また、AIで生成した画像内の人物の目鼻立ちが不自然な場合もあります。ComfyUIの自動化ワークフローを使用すれば、これらの欠点を専門家がレタッチしたかのようにきれいに修正できます。
このプロセスは2つのステップで構成されます。1つ目は、解像度を高めるアップスケーリングの段階です。Nano Banana Proは、小さな画像を4倍大きな高解像度画像(4K)に変換する能力を持っています。ComfyUIで「Upscale」ノードを接続すれば、単にサイズを大きくするだけでなく、ピクセル間の空白をインテリジェントに埋めていきます。ぼやけていた髪の毛一本一本、服の質感、肌の質感が鮮明に蘇ります。
2つ目は、顔を修正する「Face Detailer」の段階です。このノードはComfyUI Impact Packに含まれています。画像から人物の顔の部分だけを自動的に検出します。そして、Nano Banana Proに「この顔をより鮮明で自然に描き直して」と命令します。瞳の輝き、唇の輪郭、肌の毛穴まで繊細に描写されます。RunComfyで公開されたFace Detailerワークフローは、世界中のクリエイターから高い評価を受けました。このワークフローは、face_yolov8m.ptモデルで顔を感知し、SAM(Segment Anything Model)で精密なマスクを作成した後、4x UltraSharpモデルでアップスケールします。Guide Sizeは256、Max Sizeは768に設定するのがSD 1.5チェックポイントに適しています。SDXLチェックポイントを使用する場合は、Guide Sizeを512、Max Sizeを1024に上げるのが良いでしょう。
2025年に公開されたFace Enhancer Ultraワークフローは、さらに高速な処理速度を誇ります。このワークフローは低いシグマ(sigma)範囲でのみ動作し、顔の詳細をわずか数ステップで改善します。元の構造を変更せずに細かなディテールだけを追加するため、自然な結果が得られます。
これらすべてのプロセスは、ボタン一つで行われます。修正したい写真をフォルダに入れておくだけです。ComfyUIが自動的に写真を読み込み、解像度を高め、顔を整えた後、完成した写真フォルダに保存します。古い家族写真を復元したり、ぼやけて撮れた「最高の一枚」を蘇らせたりするのに非常に有用な技術です.
[顔補正および解像度復元のためのプロンプト例]
事例A:低解像度の人物写真を復元する
ワークフロー設定
Image Loadノード:低解像度の人物写真を読み込む
Upscaleノード:4x-UltraSharp.pthモデルを適用
Face Detailerノード:face_yolov8m.pt (bbox_detector), sam_vit_b_01ec64.pth (SAM_Model)
Save Image노드: 結果を保存
Face Detailer設定値 Guide Size: 512 Max Size: 1024 Feather: 5 Noise Mask: enabled Denoise: 0.4
補正プロンプト Enhance the facial details to look like a professional studio portrait. Make the skin texture look realistic with visible pores and natural subsurface scattering. Eyes should be sharp, clear, and symmetrical with visible catchlights. Improve the hair definition to show individual strands. Fix any artifacts, noise, or blurriness. Maintain the original facial identity, expression, and skin tone. Do not change the person's appearance, only improve quality. The result should look like it was taken with a high-end DSLR camera with perfect focus.
日本語訳 顔のディテールをプロのスタジオで撮影したポートレートのように向上させて。毛穴が見え、自然な皮下散乱(subsurface scattering)があるリアルな肌の質感を再現して。目は鮮明でクリア、左右対称であり、キャッチライトが見えるように。髪の毛は一本一本が見えるように鮮明度を高めて。ノイズやぼやけを修正して。元の顔の特徴、表情、肌のトーンは維持して。外見を変えずに品質だけを改善して。結果は、完璧なピントの高級DSLRカメラで撮影されたように見える必要がある。
事例B:AI生成画像の顔の欠陥を修正する
状況説明 AIで生成した画像で、目が非対称だったり、歯が不自然だったり、肌の質感が不自然な場合
Face Detailerプロンプト Fix the facial anomalies in this AI-generated image. Correct any asymmetry in the eyes, ensuring both eyes are the same size and aligned properly. Fix any issues with teeth to look natural and properly aligned. Smooth out any unnatural skin textures or artifacts while maintaining realistic pore detail. Ensure the facial proportions follow natural human anatomy. The nose, lips, and ears should look anatomically correct. Keep the overall style and artistic direction of the original image. Only fix the obvious flaws without changing the character's identity.
日本語訳 このAI生成画像の顔の異常を修正して。目の非対称を矯正し、両目が同じ大きさで正しく配置されるようにして。歯の問題を修正して自然で整った見た目にして。リアルな毛穴のディテールを維持しながら、不自然な肌の質感やアーティファクトを滑らかにして。顔の比率が自然な人体解剖学に従うようにして。鼻、唇、耳が解剖学的に正しく見えるように。元の画像の全体的なスタイルと芸術的な方向性は維持して。キャラクターのアイデンティティを変えずに、明らかな欠陥だけを修正して。
事例C:古い家族写真を復元する
ワークフロー設定
Image Load:スキャンされた古い写真
Color Correctionノード:色補正
Upscale: 4x_foolhardy_Remacri.pth
Face Detailer: 2パス方式の適用
Final Output: 高解像度復元画像
復元プロンプト Restore this old photograph while preserving its nostalgic character. Remove scratches, dust spots, and film grain damage. Correct any color fading - restore natural skin tones and fabric colors that may have yellowed over time. Enhance facial details that have been lost to age and low resolution. Sharpen the image but avoid over-processing that makes it look artificial. Maintain the era-appropriate clothing and hairstyle details. The goal is to make it look like a well-preserved photograph from that time period, not a modern photo. Preserve any handwritten notes or dates visible in the image.
日本語訳 ノスタルジックな特性を維持しながら、この古い写真を復元してください。傷、ホコリ、フィルム粒子の損傷を取り除きます。色あせを補正し、時間の経過とともに黄色くなった自然な肌の色や生地の色を復元します。経年劣化や低解像度で失われた顔のディテールを向上させます。画像を鮮明にしますが、人工的に見えるような過剰な処理は避けてください。その時代にふさわしい服装や髪型のディテールを維持します。目標は、現代の写真ではなく、当時の状態が良く保存された写真のように見せることです。画像に見える手書きのメモや日付は保存してください。
事例D:大量の人物写真の一括補正
バッチ処理設定 Input Folder: ./photos/raw_portraits/ Output Folder: ./photos/enhanced_portraits/ Batch Size: 50 Auto Queue: enabled Face Detection Threshold: 0.7 Skip if no face detected: true 一括補正プロンプト Apply professional portrait enhancement to each photo. Enhance skin clarity while maintaining natural texture - remove blemishes but keep freckles and beauty marks. Brighten under-eye areas slightly to reduce dark circles. Add subtle catchlights to eyes if missing. Ensure consistent color grading across all images with natural, warm tones. Sharpen details appropriately for high-resolution output suitable for printing. Do not alter facial structure or body shape. Maintain each person's unique characteristics while elevating overall image quality to professional standards.
日本語訳 各写真にプロフェッショナルな人物写真補正を適用してください。自然な質感を維持しながら肌の透明度を高めます。シミは取り除きますが、そばかすやほくろは維持してください。目の下のクマを軽減するために、目の下の部分を少し明るくします。キャッチライトがない場合は、さりげなく追加してください。すべての画像に自然で温かみのあるトーンの一貫したカラーグレーディングを適用します。印刷に適した高解像度出力のために、ディテールを適切にシャープにします。顔の構造や体型は変更しないでください。全体の画質をプロレベルに引き上げつつ、一人ひとりの個性は維持します。

















