Files
blog/skills/image-generation.md
T
ozan 6be7664ca8 Initial blog repo: 5 posts, 5 skills, CC BY 4.0
Blog posts covering agentic workflows, Gitea fork, Godot optimisation,
studio CLI, and fal.ai image generation for game dev.

Skills: image-generation (fal.ai), concept-art-pipeline, sora2-video,
tripo-browser-workflow, blog authoring.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-25 22:41:40 +01:00

7.7 KiB

Skill: Image Generation with fal.ai Flux

Generate game art, concept art, icons, logos, trailer frames, and marketing visuals using fal.ai Flux models. This skill teaches an AI agent how to call fal.ai's API with structured prompts optimised for game development.

Overview

fal.ai hosts Flux image generation models with a simple API. You describe what you want, pick a model and size, and get back a URL to the generated image. Costs range from $0.004 to $0.015 per image.

Models

Model Quality Cost/img Speed Use
fal-ai/flux-2-pro High ~$0.01 ~15s Default. Final art, icons, trailer frames. Most reliable.
fal-ai/flux/schnell Fast $0.004 ~4s Quick mockups, iteration, exploration
fal-ai/flux-pro/v1.1-ultra Ultra $0.015 ~8s Highest quality, but can be slow. Fall back to flux-2-pro if it hangs.
fal-ai/ideogram/v2 Typography $0.008 ~5s Logos with readable text, posters, banners

How to pick: Use flux-2-pro for most work. Use schnell when iterating fast. Use ideogram/v2 when you need readable text in the image.

Sizes

Value Dimensions Use
square 512x512 Icons, favicons
square_hd 1024x1024 App icons, logos, character portraits
landscape_16_9 1024x576 Trailer frames, hero images, Steam banners
portrait_16_9 576x1024 Steam capsules, posters, mobile splash screens

API Usage

Python (fal-client)

import fal_client

result = fal_client.subscribe("fal-ai/flux-2-pro", arguments={
    "prompt": "Your detailed prompt here",
    "image_size": "landscape_16_9",
    "num_images": 1,
})

image_url = result["images"][0]["url"]
print(image_url)

JavaScript

import * as fal from "@fal-ai/serverless-client";

const result = await fal.subscribe("fal-ai/flux-2-pro", {
  input: {
    prompt: "Your detailed prompt here",
    image_size: "landscape_16_9",
    num_images: 1,
  },
});

console.log(result.images[0].url);

cURL

curl -X POST "https://queue.fal.run/fal-ai/flux-2-pro" \
  -H "Authorization: Key $FAL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Your detailed prompt here",
    "image_size": "landscape_16_9",
    "num_images": 1
  }'

Image-to-image (reference images)

Pass a reference image URL for guided generation:

result = fal_client.subscribe("fal-ai/flux-2-pro", arguments={
    "prompt": "Same scene but at sunset, warm golden light",
    "image_url": "https://your-reference-image.png",
    "image_size": "landscape_16_9",
})

For dual-reference compositing (mixing elements from two images), pass comma-separated URLs and describe which elements come from which reference in the prompt.

Prompt Engineering --- the 4-Layer Pattern

This pattern consistently produces the best results for game art. Each layer adds specificity.

Layer 1: Design context

Set the overall art direction. This anchors the model's style. Example for a Polynesian survival game:

Art direction: stylized 3D render for a survival colony sim set in a Polynesian
archipelago. Warm earthy palette --- browns, tans, dark reds, cream, ocean blues.
Carved wood textures, koru spirals, woven pandanus patterns. Moana-meets-Valheim
aesthetic. Game engine quality, not photorealistic.

Adapt this to your game's art style. The key is being specific about palette, materials, and cultural references.

Layer 2: Scene description

Describe exactly what should appear, element by element:

  • Camera angle and POV
  • Characters (count, poses, clothing, expressions)
  • Environment (time of day, weather, terrain, vegetation)
  • Colours and lighting
  • Technical style (stylised realism, cel-shaded, pixel art, etc.)

Be specific. "A warrior standing on a beach" produces generic results. "A Polynesian warrior in a T-pose, front view, wearing tapa cloth wrap and cowrie shell necklace, matte skin, earthy tones, dark grey background" produces usable concept art.

Layer 3: Negative prompt

Always include what you don't want:

Do not include: cartoon style, anime style, photorealistic render, extra text
or taglines, watermark, deformed elements, modern or sci-fi elements.

Extend with subject-specific negatives. For character art: "no extra fingers, no merged limbs, no floating accessories."

Layer 4: Reference images (optional)

When you have existing art to match, pass it as image_url. Describe in the prompt which elements to keep: "Same character design but in a side view. Keep the clothing and hair style from the reference."

Game Dev Use Cases

Character concept art

Stylized 3D render of a young Polynesian woman in T-pose, front view.
Wearing woven pandanus skirt and tapa cloth top. Cowrie shell necklace,
bone bracelet on left wrist only. Hair swept back over one shoulder,
decorated with a hibiscus flower. Matte skin, warm brown tones.
Neutral confident expression. Dark grey background.
Size: square_hd (1024x1024)

Trailer frames / key art

Wide cinematic shot of a coastal village at golden hour. Thatched-roof
huts on stilts along a turquoise lagoon. Outrigger canoes pulled up on
white sand. Volcanic mountain in the background with clouds wrapping
the peak. Warm orange sunlight, long shadows. Stylized game engine
quality, not photorealistic.
Size: landscape_16_9 (1024x576)

UI icons

Game icon: a carved wooden fishing hook with a glowing blue thread
wrapped around the shaft. Dark background, subtle ambient occlusion.
Clean silhouette, suitable for a 64x64 game UI icon.
Size: square (512x512)

Logo with text

Game logo: the word "ARIKI" in thick bold blocky capital letters.
Each letter carved from dark mahogany wood with distinct Polynesian
tribal patterns (koru spirals, chevrons, wave motifs) carved as
deep relief. Different pattern per letter. Warm directional lighting
from above-left. Dark background.
Size: square_hd (1024x1024)
Model: ideogram/v2 (for readable text)

Best Practices

Do Don't
Be specific per-element Write vague one-line prompts
Always include negative prompts Skip negatives and hope for the best
Use flux-2-pro for final art Default to the most expensive model
Use schnell for rapid iteration Spend $0.01/img on throwaway drafts
Generate 2-3 variants and pick the best Generate one and accept it
Save prompts alongside images Lose track of what prompt made what
Match your game's art style in Layer 1 Let the model pick a random style
Use reference images for consistency Describe the same character differently each time

Cost Tracking

Scenario Cost
1 quick mockup (schnell) $0.004
1 final frame (flux-2-pro) ~$0.01
10-iteration design session ~$0.10
Full character sheet (4 views x 3 variants) ~$0.12
20-frame trailer storyboard ~$0.20

At these prices, the bottleneck is creative direction, not budget.

Common Mistakes

Mistake Fix
Generic one-line prompts Use the 4-layer pattern
No art direction context Always set Layer 1 for your game's style
No negative prompt Always include what you don't want
Using the wrong model for text Use ideogram/v2 for logos with readable text
Not iterating Generate 2-3 variants, pick the best, refine
Inconsistent character designs Use reference images to anchor style across generations