mcpField
F
fal-gamedev

fal-gamedev

github.com/fal-ai-communityクリエイティブ・メディア257385 回インストール24 週間前に更新
リポジトリ

fal-gamedev について

genmedia CLIで2Dピクセルアートのゲーム素材を作るスキルです。キャラクター、アニメーション用スプライトシート、透過素材、背景を扱い、横スクロールとアイソメトリックRPGの手順を備えています。

主な機能

  1. 01ピクセルアートキャラクターの生成
  2. 02横スクロール用スプライトシート
  3. 03アイソメトリックRPG用シート
  4. 04スプライトシートの背景除去
  5. 05パララックス背景とアイソメトリック背景

活用シーン

  1. 01テキストや画像からゲームキャラクターを作成
  2. 02歩行、ジャンプ、攻撃、待機アニメーションの生成
  3. 03透過スプライトシートの作成
  4. 04横スクロールやRPGの背景制作

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/fal-ai-community/skills --skill fal-gamedev

インストール後、Claude Code で/fal-gamedevを入力して読み込まれたか確認します。

詳細

2D ゲームアセット

genmedia CLI が必要です(genmedia init を一度実行してください)。

2D ピクセルアートのゲームアセットを作成するための完全なパイプラインです:キャラクター → スプライトシート → 背景の削除 → ゲーム背景。各レシピは個別に実行できるため、必要な部分だけを実行してください。

出力を機械可読にするため、必ず --json を使用してください。ファイルをローカルに保存するには --download を使用してください。URLを手動で curl してはいけません。--download フラグを使用してください。


実行ルール(必ず厳守してください)

  1. genmedia コマンドごとに Bash ツール呼び出しを 1 回行います:各 genmedia run と genmedia status を、それぞれ個別のツール呼び出しとして実行してください。変数の代入、パイプ、シェルのリダイレクトは使用しないでください。これにより、すべての呼び出しが genmedia * の許可リストに一致し、権限確認を求められずに実行できます。

  2. 並列ジョブ → 非同期:各 genmedia run --async を個別の Bash ツール呼び出しとして実行してください(1 つのシェルブロックにまとめないでください)。すべてのジョブはキューに追加され、fal 側で並列実行されます。合計所要時間は最も遅い単一ジョブとほぼ同じです。すべてのジョブを起動したら、genmedia status で順番にポーリングしてください(並列ではなく、1 つの失敗によって他のジョブがキャンセルされないようにします)。

# Step 1, fire async (each line = its own Bash tool call, returns request_id immediately)
genmedia run fal-ai/nano-banana-pro/edit --prompt "$WALK_PROMPT" --image_urls "[\"$CHARACTER_URL\"]" --aspect_ratio "1:1" --resolution "1K" --async --json
genmedia run fal-ai/nano-banana-pro/edit --prompt "$IDLE_PROMPT" --image_urls "[\"$CHARACTER_URL\"]" --aspect_ratio "1:1" --resolution "1K" --async --json

# Step 2, poll sequentially (each line = its own Bash tool call)
genmedia status fal-ai/nano-banana-pro/edit <walk_request_id> --result --download ./walk.png --json
genmedia status fal-ai/nano-banana-pro/edit <idle_request_id> --result --download ./idle.png --json
  1. URL の取得元:ツールの結果 JSON から、必ず downloaded_files[0].url を読み取ってください。これはすべてのモデル(nano、gpt、Bria)に共通する正しいパスです。

  2. Bria の同期実行:Bria(fal-ai/bria/background/remove)にはキューエンドポイントがなく、--async にも対応していません。同期実行してください。数秒で完了します。

  3. フォルダー構成:常にこの構成で保存し、キャラクターの説明からキャラクタースラッグを作成してください(ケバブケース。例:pirate-carrot):

./game-assets/
<character-slug>/
character.png
sprites/
walk.png
idle.png
attack.png
jump.png
backgrounds/
layer1-sky.png
layer2-midground.png
layer3-foreground.png

ダウンロードする前にフォルダーを作成してください(mkdir -p)。一部だけ実行する場合(例:スプライトシートを 1 つだけ作成する場合)も、この構成を使用してください。スプライトシートは必ず sprites/ に保存します。

  1. 最後の概要:すべてのダウンロードが完了したら、各ファイルのパスと CDN URL を一覧にした概要を出力してください。形式:
=== Game Assets: pirate-carrot ===
character game-assets/pirate-carrot/character.png
https://...
walk game-assets/pirate-carrot/sprites/walk.png
https://...
  1. ステータスポーリング時の 400 エラー:genmedia status --result は結果を 1 回取得します。自動的にポーリングはしません。"Request is still in progress" を含む 400 が返された場合、ジョブはまだ実行中です。10 秒待ってから、同じ request_id を指定して、まったく同じ genmedia status 呼び出しを再試行してください。元の genmedia run --async を再実行してはいけません(ジョブはすでに fal 側で実行中です)。結果の取得に成功するまで、10~15 秒ごとに再試行してください。

使用する場面

  • テキストによる説明や参照画像から、ピクセルアートのキャラクターを生成する
  • 横スクロールゲーム用のスプライトシートアニメーション(歩行、ジャンプ、攻撃、待機)を作成する
  • RPG 用のアイソメトリックなスプライトシート(複数方向の歩行、攻撃、待機)を作成する
  • スプライトシートから背景を削除し、透過 PNG を作成する
  • 横スクロールゲーム用のパララックス背景(3 層)を生成する
  • RPG 用のトップダウン型アイソメトリックゲームマップを生成する

使用モデル

  • Nano Banana Pro:fal-ai/nano-banana-pro。キャラクターと背景の生成に使用します。品質が高く、処理も高速なため、デフォルトとして推奨します
  • Nano Banana Pro Edit:fal-ai/nano-banana-pro/edit。キャラクター画像からスプライトシートを生成します
  • GPT-Image-2:openai/gpt-image-2。キャラクターと背景の生成に使用します。nano より処理が遅いため、ユーザーが希望する場合、または出力を安くしたい場合(quality=low)に使用してください
  • GPT-Image-2 Edit:openai/gpt-image-2/edit。スプライトシートの生成に使用します。nano より処理が遅く、モデル固有の歩行プロンプトが必要です。安価に実行するには quality=low を使用してください
  • Bria RMBG 2.0:fal-ai/bria/background/remove。すべてのスプライトシートの背景を削除します

レシピ 1. キャラクターを生成する

ユーザーに、キャラクターの説明(テキスト)または変換する既存の画像を尋ねてください。モデルの希望も尋ねてください:nano(デフォルト。品質が高く、処理も高速)または gpt(処理は遅め。出力を安くしたい場合は quality=low を使用)。

CHARACTER_STYLE_PROMPT="Generate a single character only, centered in the frame on a plain white background. The character should be rendered in detailed 32-bit pixel art style (like PlayStation 1 / SNES era games). Include proper shading, highlights, and anti-aliased edges for a polished look. The character should have well-defined features, expressive details, and rich colors. Show in a front-facing or 3/4 view pose, standing idle, suitable for sprite sheet animation."

IMAGE_TO_PIXEL_PROMPT="Transform this character into detailed 32-bit pixel art style (like PlayStation 1 / SNES era games). IMPORTANT: Must be a FULL BODY shot showing the entire character from head to feet. Keep the character centered in the frame on a plain white background. Include proper shading, highlights, and anti-aliased edges for a polished look. The character should have well-defined features, expressive details, and rich colors. Show in a front-facing or 3/4 view pose, standing idle, suitable for sprite sheet animation. Maintain the character's key features, colors, and identity while converting to pixel art."

# Text → pixel art character (nano)
genmedia run fal-ai/nano-banana-pro \
 --prompt "$CHARACTER_STYLE_PROMPT Character: <character_desc>" \
 --aspect_ratio "1:1" --resolution "1K" \
 --download ./game-assets/<slug>/character.png --json

# Text → pixel art character (gpt)
genmedia run openai/gpt-image-2 \
 --prompt "$CHARACTER_STYLE_PROMPT Character: <character_desc>" \
 --image_size "square_hd" --quality "high" \
 --download ./game-assets/<slug>/character.png --json

# Existing image → pixel art (nano), upload source image first, then run edit
genmedia upload /path/to/image.png --json
genmedia run fal-ai/nano-banana-pro/edit \
 --prompt "$IMAGE_TO_PIXEL_PROMPT" \
 --image_urls "[\"<uploaded_url_from_above>\"]" \
 --aspect_ratio "1:1" --resolution "1K" \
 --download ./game-assets/<slug>/character.png --json

ツールの結果から downloaded_files[0].url を読み取ってください。これが CHARACTER_URL で、すべてのスプライトシートレシピに必要です。


レシピ 2. スプライトシートを生成する

レシピ 1 の CHARACTER_URL を渡します。--style side(横スクロール)または --style iso(アイソメトリック RPG)を選びます。モデルは nano または gpt を選びます。

横スクロールのシート:4 フレームの 2×2 グリッドアニメーションです。対応するタイプは walk、jump、attack、idle です。ユーザーから明示的なリクエストがない限り、追加のアニメーションタイプ(hurt、death、run など)は生成しないでください。

すべてのシートを非同期で実行し(それぞれ個別の Bash ツール呼び出し)、その後、順番にポーリングします。

WALK_PROMPT="Create a 4-frame pixel art walk cycle sprite sheet of this character. Arrange the 4 frames in a 2x2 grid on white background. The character is walking to the right. Top row (frames 1-2): Frame 1 (top-left): Right leg forward, left leg back - stride position. Frame 2 (top-right): Legs close together, passing/crossing - transition. Bottom row (frames 3-4): Frame 3 (bottom-left): Left leg forward, right leg back - opposite stride. Frame 4 (bottom-right): Legs close together, passing/crossing - transition back. Each frame shows a different phase of the walking motion. This creates a smooth looping walk cycle. Use detailed 32-bit pixel art style with proper shading and highlights. Same character design in all frames. Character facing right."

WALK_PROMPT_GPT="Create a 4-frame pixel art walk cycle sprite sheet of this character. Character orientation (critical): The character is shown in SIDE PROFILE, with their face, chest, and front foot pointing toward the RIGHT edge of the image. The character's back is on the LEFT side of the image. This is the same side-profile orientation used in classic 2D platformers like Super Mario Bros or Mega Man moving rightward across the screen. Arrange the 4 frames in a 2x2 grid on white background. Top row (frames 1-2): Frame 1 (top-left): Front leg (right leg) extended forward toward the right edge of the image, back leg extended behind toward the left edge. Frame 2 (top-right): Legs close together, passing pose. Bottom row (frames 3-4): Frame 3 (bottom-left): Opposite stride, back leg (left leg) now forward toward the right edge. Frame 4 (bottom-right): Legs close together, passing pose. Use detailed 32-bit pixel art style with proper shading and highlights. Same character design in all frames. All 4 frames must show the character from the SAME side profile angle, facing the RIGHT edge of the image."

JUMP_PROMPT="Create a 4-frame pixel art jump animation sprite sheet of this character. Arrange the 4 frames in a 2x2 grid on white background. The character is jumping. Top row (frames 1-2): Frame 1 (top-left): Crouch/anticipation - character slightly crouched, knees bent, preparing to jump. Frame 2 (top-right): Rising - character in air, legs tucked up, arms up, ascending. Bottom row (frames 3-4): Frame 3 (bottom-left): Apex/peak - character at highest point of jump, body stretched or tucked. Frame 4 (bottom-right): Landing - character landing, slight crouch to absorb impact. Use detailed 32-bit pixel art style with proper shading and highlights. Same character design in all frames. Character facing right."

ATTACK_PROMPT="Create a 4-frame pixel art attack animation sprite sheet of this character. Arrange the 4 frames in a 2x2 grid on white background. The character is performing an attack that fits their design - could be a sword slash, magic spell, punch, kick, or energy blast depending on what suits the character best. Top row (frames 1-2): Frame 1 (top-left): Wind-up/anticipation - character preparing to attack, pulling back weapon or gathering energy. Frame 2 (top-right): Attack in motion - the strike or spell being unleashed. Bottom row (frames 3-4): Frame 3 (bottom-left): Impact/peak - maximum extension of attack, weapon fully swung or spell at full power. Frame 4 (bottom-right): Recovery - returning to ready stance. Use detailed 32-bit pixel art style with proper shading and highlights. Same character design in all frames. Character facing right. Make the attack visually dynamic and exciting."

IDLE_PROMPT="Create a 4-frame pixel art idle/breathing animation sprite sheet of this character. Arrange the 4 frames in a 2x2 grid on white background. The character is standing still but with subtle idle animation. Top row (frames 1-2): Frame 1 (top-left): Neutral standing pose - relaxed stance. Frame 2 (top-right): Slight inhale - chest/body rises subtly, maybe slight arm movement. Bottom row (frames 3-4): Frame 3 (bottom-left): Full breath - slight upward posture. Frame 4 (bottom-right): Exhale - returning to neutral, slight settle. Keep movements SUBTLE - this is a gentle breathing/idle loop, not dramatic motion. Character should look alive but relaxed. Use detailed 32-bit pixel art style with proper shading and highlights. Same character design in all frames. Character facing right."

# Fire all 4 async, each is its own Bash tool call
genmedia run fal-ai/nano-banana-pro/edit --prompt "$WALK_PROMPT" --image_urls "[\"$CHARACTER_URL\"]" --aspect_ratio "1:1" --resolution "1K" --async --json
genmedia run fal-ai/nano-banana-pro/edit --prompt "$JUMP_PROMPT" --image_urls "[\"$CHARACTER_URL\"]" --aspect_ratio "1:1" --resolution "1K" --async --json
genmedia run fal-ai/nano-banana-pro/edit --prompt "$ATTACK_PROMPT" --image_urls "[\"$CHARACTER_URL\"]" --aspect_ratio "21:9" --resolution "1K" --async --json
genmedia run fal-ai/nano-banana-pro/edit --prompt "$IDLE_PROMPT" --image_urls "[\"$CHARACTER_URL\"]" --aspect_ratio "1:1" --resolution "1K" --async --json

# Poll each, each is its own Bash tool call, run sequentially
genmedia status fal-ai/nano-banana-pro/edit <walk_request_id> --result --download ./game-assets/<slug>/sprites/walk.png --json
genmedia status fal-ai/nano-banana-pro/edit <jump_request_id> --result --download ./game-assets/<slug>/sprites/jump.png --json
genmedia status fal-ai/nano-banana-pro/edit <attack_request_id> --result --download ./game-assets/<slug>/sprites/attack.png --json
genmedia status fal-ai/nano-banana-pro/edit <idle_request_id> --result --download ./game-assets/<slug>/sprites/idle.png --json

# GPT variants: replace fal-ai/nano-banana-pro/edit with openai/gpt-image-2/edit
# Walk must use WALK_PROMPT_GPT (not WALK_PROMPT)
# Replace --aspect_ratio with explicit --image_size:
# 1:1 → --image_size "square_hd"
# 21:9 → --image_size "{\"width\": 2688, \"height\": 1152}"

アイソメトリック RPG のシート:3/4 の俯瞰視点です。対応するタイプは walk-down、walk-up、walk-side、attack-down、attack-up、attack-side、idle-iso です。ユーザーから明示的なリクエストがない限り、追加のアニメーションタイプは生成しないでください。

まず attack-down を生成します。attack-up と attack-side は、スタイルの一貫性を保つために、どちらもこれを参照します。

WALK_DOWN_PROMPT="Create a 4-frame pixel art walk cycle sprite sheet of this character walking DOWNWARD (toward the camera) in a top-down isometric RPG perspective (3/4 overhead view, like a classic top-down RPG). Arrange the 4 frames in a 2x2 grid on white background. The character is walking toward the viewer (south/down). Top row: Frame 1 (top-left): Left foot forward stride, arms swinging naturally. Frame 2 (top-right): Feet together, passing/transition pose. Bottom row: Frame 3 (bottom-left): Right foot forward stride, arms swinging naturally. Frame 4 (bottom-right): Feet together, passing/transition back. We see the character's front/face. Top-down 3/4 view - we see the top of their head slightly. Use detailed 32-bit pixel art style with proper shading and highlights. Same character design in all frames."

WALK_UP_PROMPT="Create a 4-frame pixel art walk cycle sprite sheet of this character walking UPWARD (away from the camera) in a top-down isometric RPG perspective (3/4 overhead view, like a classic top-down RPG). Arrange the 4 frames in a 2x2 grid on white background. CRITICAL: ALL 4 frames must show the character from EXACTLY the same angle, their BACK, facing directly away from the camera. Do NOT rotate or twist the character between frames. The ONLY difference between frames should be the leg and arm positions. Top row: Frame 1 (top-left): Left foot forward. BACK VIEW. Frame 2 (top-right): Feet together. BACK VIEW. Bottom row: Frame 3 (bottom-left): Right foot forward. BACK VIEW. Frame 4 (bottom-right): Feet together. BACK VIEW. Use detailed 32-bit pixel art style. Same character design in all frames."

WALK_SIDE_PROMPT="Create a 4-frame pixel art walk cycle sprite sheet of this character WALKING TO THE RIGHT in a top-down isometric RPG perspective (3/4 overhead view, like a classic top-down RPG). Arrange the 4 frames in a 2x2 grid on white background. The character is FACING RIGHT and WALKING RIGHT. Top row: Frame 1 (top-left): Right leg forward, left leg back - stride, arms swinging. Frame 2 (top-right): Legs close together, passing - transition. Bottom row: Frame 3 (bottom-left): Left leg forward, right leg back - opposite stride, arms swinging. Frame 4 (bottom-right): Legs close together, passing - transition back. We see the character's RIGHT-facing side profile from a top-down 3/4 overhead angle. Use detailed 32-bit pixel art style. Same character design in all frames."

ATTACK_DOWN_PROMPT="Create a 4-frame pixel art ATTACK animation sprite sheet of this character attacking DOWNWARD (toward the camera) in a top-down isometric RPG perspective (3/4 overhead view). Arrange the 4 frames in a 2x2 grid on white background. Top row: Frame 1 (top-left): Wind-up/anticipation - preparing to strike. Frame 2 (top-right): Attack in motion - strike unleashed toward camera. Bottom row: Frame 3 (bottom-left): Impact/peak - maximum extension. Frame 4 (bottom-right): Recovery. We see the character's front/face. The attack should fit the character's design. Use detailed 32-bit pixel art style. Make the attack visually dynamic."

ATTACK_UP_PROMPT="Create a 4-frame pixel art ATTACK animation sprite sheet of this character attacking UPWARD (away from the camera) in a top-down isometric RPG perspective. I've also sent you a reference of the same character's front-facing attack. Use the EXACT SAME attack type, weapon, and visual effects - just show it from behind. Arrange the 4 frames in a 2x2 grid on white background. Top row: Frame 1 (top-left): Wind-up from behind. Frame 2 (top-right): Attack unleashed upward/away. Bottom row: Frame 3 (bottom-left): Impact/peak. Frame 4 (bottom-right): Recovery. We see the character's back. MUST use the same attack style as the reference image. Use detailed 32-bit pixel art style."

ATTACK_SIDE_PROMPT="Create a 4-frame pixel art ATTACK animation sprite sheet of this character attacking SIDEWAYS (to the right) in a top-down isometric RPG perspective. I've also sent you a reference of the same character's front-facing attack. Use the EXACT SAME attack type, weapon, and visual effects - just show it from the side profile. Arrange the 4 frames in a 2x2 grid on white background. Character faces RIGHT. Top row: Frame 1 (top-left): Wind-up from side, facing right. Frame 2 (top-right): Strike unleashed to the right. Bottom row: Frame 3 (bottom-left): Impact/peak. Frame 4 (bottom-right): Recovery. IMPORTANT: Show the character's SIDE PROFILE facing RIGHT. MUST use the same attack style as the reference image. Use detailed 32-bit pixel art style."

IDLE_ISO_PROMPT="Create a 4-frame pixel art idle/breathing animation sprite sheet of this character in a top-down isometric RPG perspective (3/4 overhead view). Arrange the 4 frames in a 2x2 grid on white background. Character is FACING TOWARD THE CAMERA (south/down). Top row: Frame 1 (top-left): Neutral standing pose, facing down. Frame 2 (top-right): Slight inhale - body rises subtly. Bottom row: Frame 3 (bottom-left): Full breath - slight upward posture. Frame 4 (bottom-right): Exhale - returning to neutral. Keep movements SUBTLE. Use detailed 32-bit pixel art style. Same character design in all frames."

# Fire walk sheets + idle async, each is its own Bash tool call
genmedia run fal-ai/nano-banana-pro/edit --prompt "$WALK_DOWN_PROMPT" --image_urls "[\"$CHARACTER_URL\"]" --aspect_ratio "1:1" --resolution "1K" --async --json
genmedia run fal-ai/nano-banana-pro/edit --prompt "$WALK_UP_PROMPT" --image_urls "[\"$CHARACTER_URL\"]" --aspect_ratio "1:1" --resolution "1K" --async --json
genmedia run fal-ai/nano-banana-pro/edit --prompt "$WALK_SIDE_PROMPT" --image_urls "[\"$CHARACTER_URL\"]" --aspect_ratio "1:1" --resolution "1K" --async --json
genmedia run fal-ai/nano-banana-pro/edit --prompt "$IDLE_ISO_PROMPT" --image_urls "[\"$CHARACTER_URL\"]" --aspect_ratio "1:1" --resolution "1K" --async --json

# Poll walk results sequentially
genmedia status fal-ai/nano-banana-pro/edit <walk_down_request_id> --result --download ./game-assets/<slug>/sprites/walk-down.png --json
genmedia status fal-ai/nano-banana-pro/edit <walk_up_request_id> --result --download ./game-assets/<slug>/sprites/walk-up.png --json
genmedia status fal-ai/nano-banana-pro/edit <walk_side_request_id> --result --download ./game-assets/<slug>/sprites/walk-side.png --json
genmedia status fal-ai/nano-banana-pro/edit <idle_iso_request_id> --result --download ./game-assets/<slug>/sprites/idle-iso.png --json

# Attack-down sync, needed as reference before firing attack-up and attack-side
genmedia run fal-ai/nano-banana-pro/edit --prompt "$ATTACK_DOWN_PROMPT" --image_urls "[\"$CHARACTER_URL\"]" --aspect_ratio "9:16" --resolution "1K" --download ./game-assets/<slug>/sprites/attack-down.png --json

# Fire attack-up and attack-side async, passing attack-down URL from above result
genmedia run fal-ai/nano-banana-pro/edit --prompt "$ATTACK_UP_PROMPT" --image_urls "[\"$CHARACTER_URL\", \"<attack_down_url>\"]" --aspect_ratio "9:16" --resolution "1K" --async --json
genmedia run fal-ai/nano-banana-pro/edit --prompt "$ATTACK_SIDE_PROMPT" --image_urls "[\"$CHARACTER_URL\", \"<attack_down_url>\"]" --aspect_ratio "16:9" --resolution "1K" --async --json

genmedia status fal-ai/nano-banana-pro/edit <attack_up_request_id> --result --download ./game-assets/<slug>/sprites/attack-up.png --json
genmedia status fal-ai/nano-banana-pro/edit <attack_side_request_id> --result --download ./game-assets/<slug>/sprites/attack-side.png --json

# GPT variants: replace fal-ai/nano-banana-pro/edit with openai/gpt-image-2/edit
# Replace --aspect_ratio with explicit --image_size:
# 1:1 → --image_size "square_hd"
# 9:16 → --image_size "{\"width\": 720, \"height\": 1280}"
# 16:9 → --image_size "{\"width\": 1280, \"height\": 720}"

レシピ 3. 背景を削除する

Bria にはキューエンドポイントがないため、同期で実行します(--async は付けません)。それぞれ個別の Bash ツール呼び出しです。

genmedia run fal-ai/bria/background/remove --image_url "<walk_url>" --download ./game-assets/<slug>/sprites/walk-transparent.png --json
genmedia run fal-ai/bria/background/remove --image_url "<jump_url>" --download ./game-assets/<slug>/sprites/jump-transparent.png --json
genmedia run fal-ai/bria/background/remove --image_url "<attack_url>" --download ./game-assets/<slug>/sprites/attack-transparent.png --json
genmedia run fal-ai/bria/background/remove --image_url "<idle_url>" --download ./game-assets/<slug>/sprites/idle-transparent.png --json

レシピ 4. 背景を生成する

パイプラインに関する注意: レイヤー 1(空)とアイソメトリックマップでは、CHARACTER_DESC のみが必要で、画像参照は不要です。キャラクターの生成直後にレイヤー 1 を非同期で実行し、スプライトシートの生成中に並行して処理します。レイヤー 2 と 3 は順番に実行します(それぞれ、ツールの結果から得られる前のレイヤーの URL が必要です)。

横スクロール、3 レイヤーのパララックス

# Layer 1, sky/backdrop. Fire async (no image dep) so it runs in parallel with sprite generation
genmedia run fal-ai/nano-banana-pro \
 --prompt "Create the SKY/BACKDROP layer for a side-scrolling pixel art game parallax background. This is for a character: <character_desc>. Create an environment that fits this character's world. This is the FURTHEST layer - only sky and very distant elements (distant mountains, clouds, horizon). Style: Pixel art, 32-bit retro game aesthetic. Wide panoramic scene." \
 --aspect_ratio "21:9" --resolution "1K" --async --json

# Poll Layer 1 (after sprite sheets are done), then read its URL from the result
genmedia status fal-ai/nano-banana-pro <layer1_request_id> --result --download ./game-assets/<slug>/backgrounds/layer1-sky.png --json

# Layer 2, midground (needs CHARACTER_URL + layer1 URL from above result)
genmedia run fal-ai/nano-banana-pro/edit \
 --prompt "Create the MIDDLE layer of a 3-layer parallax background for a side-scrolling pixel art game. I've sent you images of: 1) the character, 2) the sky layer already created. Create the character's ICONIC/CANONICAL location from their story, home village, famous landmarks, signature battlegrounds. Elements should fill the frame from middle down to bottom. Style: Pixel art matching the other images. IMPORTANT: Use a transparent background so this layer can overlay the others." \
 --image_urls "[\"<character_url>\", \"<layer1_url>\"]" \
 --aspect_ratio "21:9" --resolution "1K" --download ./game-assets/<slug>/backgrounds/layer2-midground.png --json

# Bria bg-remove on layer 2 (sync, no queue endpoint)
genmedia run fal-ai/bria/background/remove --image_url "<layer2_url>" --download ./game-assets/<slug>/backgrounds/layer2-transparent.png --json

# Layer 3, foreground (needs CHARACTER_URL + layer1 URL + layer2-transparent URL from above result)
genmedia run fal-ai/nano-banana-pro/edit \
 --prompt "Create the FOREGROUND layer of a 3-layer parallax background for a side-scrolling pixel art game. I've sent you images of: 1) the character, 2) the sky layer, 3) the middle layer. Create the closest foreground elements (ground, grass, rocks, platforms) that complete the scene. Style: Pixel art matching the other images. IMPORTANT: Use a transparent background so this layer can overlay the others." \
 --image_urls "[\"<character_url>\", \"<layer1_url>\", \"<layer2_transparent_url>\"]" \
 --aspect_ratio "21:9" --resolution "1K" --download ./game-assets/<slug>/backgrounds/layer3-foreground.png --json

# Bria bg-remove on layer 3 (sync, no queue endpoint)
genmedia run fal-ai/bria/background/remove --image_url "<layer3_url>" --download ./game-assets/<slug>/backgrounds/layer3-transparent.png --json

# GPT variant: replace nano endpoints with openai/gpt-image-2 and openai/gpt-image-2/edit
# Use --image_size '{"width": 2688, "height": 1152}' for 21:9 with gpt

アイソメトリック、単一のトップダウンマップ

genmedia run fal-ai/nano-banana-pro \
 --prompt "Create a large, detailed top-down isometric pixel art game world map for a character: $CHARACTER_DESC. Do not place the character on the map. Style: Classic RPG top-down map, 3/4 overhead perspective. Include: winding dirt/stone paths connecting areas, a small body of water, a few buildings or structures that fit the character's world, rocky areas or hills, various terrain types. Single large continuous map image (NOT tiled, NOT a tileset). Complete explorable game world viewed from above. Detailed 32-bit pixel art style. Fill the entire image with map content, no empty borders." \
 --aspect_ratio "1:1" --resolution "1K" \
 --download ./game-assets/<slug>/backgrounds/map.png --json

パラメーター

  • モデル:デフォルトは nano です。品質が高く、処理も速くなります。gpt は低速です。ユーザーが明示的に指定した場合、または最も安価な方法を求めている場合に使用し、その場合はコストを大幅に抑えるため --quality "low" を設定します。
  • Walk + gpt-image-2:WALK_PROMPT ではなく、必ず WALK_PROMPT_GPT を使用します。方向を正しく生成するには、GPT に横向きのプロフィールの向きを明示的に指示する必要があります。
  • 攻撃のアスペクト比:横スクロールの攻撃では 21:9(nano)または 2688×1152(gpt)を使用します。アイソメトリックの攻撃では、down/up に 9:16、side に 16:9 を使用します。
  • アイソメトリックの attack-up と attack-side:攻撃スタイルを方向間で一貫させるため、必ず ATTACK_DOWN_URL を 2 番目の参照画像として渡します。
  • 背景レイヤー:順番に生成します(1 → 2 → 3)。各レイヤーは前のレイヤーを参照します。レイヤー 1 は背景を保持し、レイヤー 2 と 3 は背景を削除します。

コメント