画像生成プロンプトの構成要素
被写体、スタイル、媒体、照明、カラーパレット、構図の要素を学びます。
「画像生成プロンプトの構成要素」はCoddyKit上の無料AI Prompt Engineeringレッスンです。 これはレッスン1/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはAI Prompt Engineering学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 AI Prompt Engineeringコースには全4レッスンが含まれています。
画像プロンプトはレシピ
画像生成プロンプトは、ビジュアルを作るためのレシピです。料理と同じように、材料の順序とバランスが重要です。要素が足りないと一般的な結果になり、要素を誤ると予想外の失敗につながります。プロンプトの構造を習得すれば、創作を予測可能な形でコントロールできるようになります。
6つの基本構成要素
優れた画像プロンプトには、6つの構成要素が含まれます。Subject(何を)、Style(どのように見えるか)、Medium(芸術形式)、Lighting(照明)、Color Palette(色調)、Composition(構図)です。どれか一つでも省くと、モデルは推測に頼ることになり、通常は一般的なデフォルト設定が使われます。
# Anatomy of an image prompt
prompt_components = {
'subject': 'A lone lighthouse on a rocky coastline',
'style': 'dramatic, moody, cinematic',
'medium': 'oil painting',
'lighting': 'stormy overcast sky, waves crashing, dramatic side-lighting',
'color_palette': 'desaturated blues and grays with warm amber light from the lighthouse',
'composition': 'wide establishing shot, rule of thirds, lighthouse at left third'
}
# Assemble into a prompt string
full_prompt = (
'{subject}, {style}, {medium}, {lighting}, '
'{color_palette}, {composition}'
).format(**prompt_components)
print(full_prompt)
# A lone lighthouse on a rocky coastline, dramatic, moody, cinematic,
# oil painting, stormy overcast sky, waves crashing, dramatic side-lighting,
# desaturated blues and grays with warm amber light from the lighthouse,
# wide establishing shot, rule of thirds, lighthouse at left thirdSubject:何を描くか
Subjectは最も重要な構成要素で、モデルに何を描くかを伝えます。できるだけ具体的に指定し、種、年齢、感情、動作、環境、空間的な関係を含めてください。
# Subject specificity comparison
# Weak subject:
weak = 'a person in a city'
# Strong subject (same concept, much more specific):
strong = (
'a young woman in her 30s, wearing a vintage 1960s trench coat, '
'standing at a rain-soaked street corner in Tokyo at night, '
'looking up at neon signs reflected in the puddles, '
'holding a dripping umbrella, expression of quiet wonder'
)
# The strong subject answers:
# WHO: young woman, 30s
# WHAT WEARING: 1960s trench coat
# WHERE: Tokyo street corner
# WHEN: night, raining
# WHAT DOING: standing, looking up
# EXPRESSION: quiet wonder
# KEY DETAIL: neon reflections in puddles, dripping umbrella
print('Weak:', weak)
print('Strong:', strong[:100], '...')Style:どのように描くか
Styleの記述子は、画像のビジュアル言語と美的な方向性をモデルに伝えます。美術運動、特定のアーティスト、ビジュアルメディア、抽象的な美的特性などを指定できます。
style_examples = [
# Art movements
'impressionist', 'art nouveau', 'bauhaus', 'minimalist', 'surrealist',
# Artist references
'in the style of Monet', 'reminiscent of Hopper', 'inspired by Klimt',
# Visual media
'film noir', 'vaporwave aesthetic', 'cottagecore', 'brutalist',
# Quality descriptors
'highly detailed', 'cinematic', 'editorial photography style',
'concept art', 'matte painting', 'character design sheet',
# Mood
'ethereal', 'gritty', 'whimsical', 'melancholic', 'vibrant', 'serene'
]
# Combining styles creates unique aesthetics
combined_style = 'cyberpunk aesthetic meets art nouveau, highly detailed, dark ethereal'
print('Combined style:', combined_style)
# Warning: too many style directives create incoherence
too_many = 'impressionist, minimalist, surrealist, photorealistic, anime, baroque'
print('Too many (incoherent):', too_many)Medium:芸術形式
Mediumは、物理的またはデジタルの芸術形式を定義します。生成画像の質感、線の品質、色調を根本的に変える要素です。一般的なMediumと、それによって生まれる表現:
medium_guide = {
# Traditional media
'oil painting': 'Rich, textured, classic look with visible brushwork',
'watercolor': 'Soft edges, translucent washes, paper texture visible',
'pencil sketch': 'Line art, cross-hatching, grayscale, raw feel',
'charcoal drawing': 'Soft, smudgy, high contrast, dramatic shadows',
'ink illustration': 'Bold lines, flat colors or crosshatching',
# Photography
'photorealistic': 'Looks like a real photograph',
'film photography': 'Grain, color shift, analog feel',
'macro photography': 'Extreme close-up, shallow depth of field',
'long exposure photography': 'Motion blur, light trails',
# Digital / 3D
'3D render': 'CGI quality, precise geometry',
'octane render': 'Photorealistic 3D with ray-tracing quality',
'Blender 3D': 'CGI aesthetic, often used with subdivision modeling',
'pixel art': 'Retro 8-bit or 16-bit style, visible pixels',
'vector illustration': 'Clean, flat, scalable design style'
}
for medium, description in list(medium_guide.items())[:5]:
print(f'{medium}: {description}')Lighting:雰囲気を形作る要素
Lightingは、ビジュアルアートで雰囲気を決める最も強力な要素です。同じ被写体でも、ゴールデンアワーの陽光の下と、厳しい取調室の照明の下では、まったく違って見えます。照明に関する語彙を習得してください。
lighting_vocabulary = {
# Time of day
'golden hour': 'Warm orange-yellow, long shadows, magic hour feel',
'blue hour': 'Cool blue twilight, soft diffused light',
'harsh midday': 'Hard shadows, washed-out, unflattering (usually avoided)',
'overcast': 'Soft even light, no shadows, good for portraits',
# Studio / artificial
'studio lighting': 'Controlled, professional, even illumination',
'Rembrandt lighting': 'Triangle of light on cheek, dramatic portrait technique',
'neon lighting': 'Colorful, urban, cyberpunk feel',
'candlelight': 'Warm, flickering, intimate',
# Dramatic
'chiaroscuro': 'Extreme light/dark contrast, Baroque dramatic style',
'volumetric lighting': 'God rays, light shafts through fog or dust',
'backlit / rim light': 'Subject outlined by light from behind, halo effect',
'bioluminescent': 'Glowing from within, alien or underwater feel'
}
example = 'volumetric lighting, golden hour, warm glow filtering through forest canopy'
print('Lighting example:', example)Color Palette:感情の方向性
Color Paletteは、画像の感情の方向性とビジュアルの統一感をコントロールします。パレットを描写的に指定することも、美術運動、映画、自然を参照して指定することもできます。
color_palette_examples = [
# Temperature-based
'warm earth tones: rust, ochre, sienna, cream',
'cool blues and silvers, icy palette',
'neutral gray monochrome with single red accent',
# Mood-based
'muted, desaturated, melancholic color grading',
'vibrant saturated colors, tropical energy',
'pastel soft colors, dreamlike softness',
# Reference-based
'Wes Anderson color palette: pastel pinks and greens',
'film noir: high contrast black and white with amber shadows',
'synthwave neon: pink, purple, cyan on dark backgrounds',
# Nature-based
'autumn forest: burnt orange, golden yellow, deep brown',
'arctic palette: white, pale blue, grey with deep navy accents',
]
# Color palettes can clash with lighting — ensure they work together
clash = 'vibrant tropical colors + film noir lighting' # incoherent
harmony = 'warm amber and ochre tones + golden hour lighting' # coherent
print('Harmonious combo:', harmony)Composition:構図と焦点
Compositionの指示は、ショットをどのように構成するか、つまり何を含め、何を強調し、要素をどこに配置するかをモデルに伝えます。写真や映画撮影で使われる語彙を取り入れると効果的です。
composition_vocabulary = {
# Camera distance
'extreme close-up': 'fills frame with a single detail (eye, hand, texture)',
'close-up': 'face or object fills most of frame',
'medium shot': 'waist to head, character-focused',
'wide shot': 'full body in environment context',
'establishing shot': 'landscape/environment, tiny or no character',
'aerial / bird\'s eye view': 'looking straight down',
'worm\'s eye view': 'looking straight up from below',
# Composition rules
'rule of thirds': 'subject at intersection of 1/3 lines',
'centered composition': 'symmetrical, formal, powerful',
'leading lines': 'lines guide eye toward subject',
'negative space': 'large empty area emphasizes subject',
'frame within frame': 'archway, window, or shape frames subject',
# Depth
'shallow depth of field': 'sharp subject, blurred background (bokeh)',
'deep focus': 'everything in sharp focus front to back'
}
print('Composition example: close-up portrait, rule of thirds, shallow depth of field, bokeh background')完全なプロンプトの組み立て
6つの構成要素を論理的な順序で組み合わせると、高品質な画像プロンプトを安定して作成できます。適した順序は、Subject → Medium → Style → Lighting → Color Palette → Compositionです。
def build_image_prompt(
subject, medium, style, lighting, color_palette, composition,
quality_boost='highly detailed, 8K resolution'
):
parts = [
subject,
medium,
style,
lighting,
color_palette,
composition,
quality_boost
]
# Filter out None values and join
return ', '.join(p for p in parts if p)
# Example: Portrait
portrait = build_image_prompt(
subject='elderly Japanese fisherman mending nets at sunrise, weathered hands, peaceful expression',
medium='oil painting',
style='impressionist, highly detailed, classical technique',
lighting='golden hour sunrise, warm light from the left, soft shadows',
color_palette='warm ochres, golds, deep navy sea in background',
composition='medium shot, rule of thirds, subject right third, ocean left'
)
print(portrait)画像間の一貫性を保つプロンプティング
画像シリーズ(キャラクターシートや絵コンテなど)を生成する場合は、画像ごとに変わる要素を変数置換するベースプロンプトのテンプレートを使って、一貫性を維持してください。
BASE_CHARACTER_TEMPLATE = (
'{character_description}, '
'{action_description}, '
'oil painting, concept art style, '
'dramatic studio lighting, '
'muted jewel tones with gold accents, '
'close-up portrait, centered composition, '
'highly detailed, cinematic'
)
character = (
'a tall warrior woman with dark braided hair, emerald eyes, '
'wearing ornate silver plate armor with dragon motifs'
)
action_variants = [
'standing at attention, stoic expression, arms crossed',
'battle-ready, sword raised, fierce expression, mid-action',
'resting against a stone wall, exhausted but resolute, soft smile',
'close-up portrait, neutral expression, slight three-quarter view'
]
for action in action_variants:
prompt = BASE_CHARACTER_TEMPLATE.format(
character_description=character,
action_description=action
)
print(f'Generating: {action[:40]}...')
# call image API with prompt品質トークン
多くの画像モデルは、望ましい出力の忠実度を示す用語である品質トークンに反応します。これらを戦略的に使うと、被写体やスタイルを変えずに詳細度を高められます。
quality_tokens = {
'high_detail': [
'highly detailed', 'intricate detail', 'ultra-detailed',
'8K resolution', '4K wallpaper quality'
],
'photorealism': [
'photorealistic', 'hyperrealistic', 'photographed by',
'DSLR photo', 'shot on 35mm film'
],
'professional_quality': [
'award-winning', 'professional photography', 'editorial quality',
'museum quality', 'masterpiece'
],
'rendering_quality': [
'octane render', 'unreal engine 5', 'ray tracing',
'subsurface scattering', 'global illumination'
]
}
# Best practice: add 2-3 quality tokens at the end of the prompt
quality_suffix = 'highly detailed, cinematic, 8K resolution'
print('Add to end of any prompt:', quality_suffix)
# Warning: do not overload with quality tokens — they dilute each other
too_many_quality = 'masterpiece, best quality, ultra-detailed, perfect, amazing, award-winning'
print('Over-specified (less effective):', too_many_quality[:60])確認問題
画像生成プロンプトのどの構成要素が、画像の感情的な雰囲気を最も直接的にコントロールしますか。
画像プロンプトの構造まとめ
適切に構成された画像プロンプトには、6つの構成要素が調和して組み込まれています。
- Subject:WHOとWHAT — 最も重要な構成要素であり、非常に具体的に指定する
- Style:美的な方向性、美術運動、またはアーティストの参照
- Medium:芸術形式(油彩画、フォトリアル、3Dレンダー、ピクセルアート)
- Lighting:雰囲気を形作る照明(ゴールデンアワー、キアロスクーロ、ネオン)
- Color Palette:感情的な温度感(暖色系のアースカラー、寒色系で低彩度、ネオン)
- Composition:構図(クローズアップ、三分割法、エスタブリッシングショット)
最後に品質トークンを2〜3個追加してください。複数画像のシリーズで一貫性を保つには、テンプレートを使用します。
よくある質問
「画像生成プロンプトの構成要素」レッスンは無料ですか?
はい。「画像生成プロンプトの構成要素」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、AI Prompt Engineeringコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 AI Prompt Engineeringコースには全4レッスンが含まれています。
「画像生成プロンプトの構成要素」で何を学びますか?
被写体、スタイル、媒体、照明、カラーパレット、構図の要素を学びます。 ブラウザで直接実行するハンズオンコードでAI Prompt Engineeringを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
AI Prompt Engineeringを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのAI Prompt Engineeringは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン1/4です。
「画像生成プロンプトの構成要素」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このAI Prompt Engineeringレッスンでコードを書いて実行できますか?
はい。すべてのAI Prompt Engineeringレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- 画像生成プロンプトの構成要素
- スタイルと芸術的媒体の指定
- ネガティブプロンプトと除外指定
- 画像プロンプトの反復的な改善