Skip to content
Use cases

AI Game Assets Generator API: Art That Holds a Style

An AI game assets generator API for concept art, props, icons and textures: one style across a set, references, batches and the cost per image.

Updated 5 min read

An AI game assets generator API turns a list of things your game needs, a sword, a potion, a stone floor, a ruined tower, into images in one consistent style. On Frameport each asset is a request to POST /v1/images/generations: the prompt carries the style, reference pictures of approved assets keep it, and a script runs the whole list. Frameport Image 1 and Nano Banana Pro read reference pictures, and Flux 3 Image works from the prompt alone.

This guide covers what a pipeline needs, how to hold a style, references, a batch in Python, what comes after generation, and the cost.

What an AI game assets generator API pipeline needs

AssetShapeWhat the prompt fixesAfter generation
Concept art: places, characters16:9, 3:4Mood, light, palette, periodPaint-over, reference for modelers
Props and item icons1:1One object, centered, on a plain backgroundBackground removed, resized
Characters for 2D3:4Front, side and back views on one sheetCut out, rigged or animated in your tool
Textures1:1Top-down, even light, the material filling the frameTested as a tile, seams fixed
Key art, store capsules16:9, 3:4Composition with room for the logoLogo and text set in your layout tool

The models return a flat image file: no transparent background, no layers, no sprite sheets and no 3D models. Each output has a content_type and a signed link that lasts about an hour, so the pipeline downloads every file to your asset folder (files). The aspect ratios are 1:1, 3:4, 4:3, 9:16 and 16:9, and a request makes up to 4 images.

Holding a style across a set

A style holds when every request repeats the same description of it and shows the same examples.

  • A style line, word for word. Write it once and append it to every prompt: "hand-painted fantasy game icon, thick dark outline, soft cel shading, warm rim light from the upper left, muted palette of ochre, teal and deep red". Change the subject, never the style line.
  • The same staging for a family of assets. Icons centered at the same size, on the same plain background, from the same angle; textures top-down in flat light.
  • Approved assets as references. Once a few renders look right, send them with every request as style references, by their file_… ids.
  • No seed to lean on. Image requests take no seed, so the style line and the references do the work.

Concept art can range wider: give each place or faction its own line, and keep the palette words shared. For one character across many images, a character sheet first is the method in the consistent character image API guide.

References: which models read them

ModelReference picturesUse it for
Frameport Image 1Up to 10, a fee for each after the firstA set in one style, edits by instruction
Nano Banana ProUp to 6Detailed key art, edits by instruction
Frameport Image 2, Frameport Image 3Up to 4, includedPhotoreal concepts, recurring characters
Flux 3 ImageNone, the prompt onlyPhotoreal and typography: titles, signs, labels

In the prompt, say what each picture is for: "in the style of the reference pictures: the same outline, shading and palette". A reference of an object says "this object"; a reference of a style says "draw like this". When a request mixes both, name in the prompt which picture is which. Edits by instruction cover the variants an inventory needs: "the same sword, with a blue glowing blade", or "the same potion, empty".

A batch of game assets in Python

This script draws a set of item icons, two takes each, in the style of two approved icons, and saves them by name:

icons.py
import os
import time

import requests

API = "https://frameport.ai/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['FRAMEPORT_API_KEY']}"}
STYLE = ("hand-painted fantasy game icon in the style of the reference pictures: the same thick dark outline, "
         "soft cel shading and palette, warm rim light from the upper left, centered, "
         "on a plain flat bright green background, no text, no border, no cast shadow")
STYLE_REFS = ["file_8Hc2RkQw5ZpT1mVb7nXe3L", "file_3Vb8KqW2nTx7Lc5Rm1YdPs"]  # two approved icons
ITEMS = ["iron sword", "health potion", "wooden shield", "golden key", "spell scroll", "leather boots"]

pending = {}
for item in ITEMS:
    gen = requests.post(f"{API}/images/generations", headers=HEADERS, timeout=60, json={
        "model": "fp-image-1",
        "prompt": f"A single {item}, {STYLE}",
        "reference_images": STYLE_REFS,
        "aspect_ratio": "1:1",
        "n": 2,
    }).json()
    if gen.get("error"):
        raise SystemExit(f"{item}: {gen['error']['code']}: {gen['error']['message']}")
    pending[gen["id"]] = item.replace(" ", "-")

os.makedirs("icons", exist_ok=True)
while pending:
    time.sleep(3)
    for gen_id, name in list(pending.items()):
        gen = requests.get(f"{API}/generations/{gen_id}", headers=HEADERS, timeout=30).json()
        if gen["status"] in ("queued", "running"):
            continue
        del pending[gen_id]
        for index, output in enumerate(gen["outputs"]):
            if output["status"] == "succeeded":
                extension = output["content_type"].split("/")[-1]
                with open(f"icons/{name}-{index + 1}.{extension}", "wb") as out:
                    out.write(requests.get(output["url"], timeout=120).content)
        print(name, gen["status"], "charged", gen["cost_usd"])
  • Price the set first. Each body sent to POST /v1/generations/quote returns its price without holding anything, and max_cost_usd on a request refuses anything above it (quotes).
  • Large sets go in waves. A workspace runs up to 20 generations at once and 60 requests a minute (rate limits). The image generation API in Python adds retries and a webhook.
  • A failed image costs nothing. A request holds the price of its images and charges each one that succeeds.

From your editor, the MCP server lets an assistant call the same models and save the files into the project: Cursor MCP image generation shows the setup.

After generation: cutouts, sheets and tiles

The finishing steps are yours, with the tools you already use. With ImageMagick:

Cut out, resize, assemble a sheet
# The plain green background becomes transparent
magick icons/iron-sword-1.png -fuzz 12% -transparent "#00FF00" cut/iron-sword.png
# Every icon at the game's size
magick cut/iron-sword.png -resize 128x128 final/iron-sword.png
# The icons on one sheet, eight per row
magick montage final/*.png -tile 8x -geometry 128x128+0+0 -background none sheet.png
  • Background removal: a plain, flat background in the prompt makes the cutout clean; check the edges, where a fringe of the background color can remain.
  • Pixel art: downscale with nearest-neighbor and reduce the palette in your pixel editor, since a generated image does not follow a pixel grid.
  • Textures: ask for "a tileable, repeating texture" in the prompt, then tile the texture yourself, offset by half its size, and fix the seams that show.
  • Animation: an image model draws one pose per image. For a rough motion study, a character image can become the first frame of a short clip (image to video), with frames pulled from it as a base for cleanup.

What a set of game assets costs

ImagesFrameport Image 1Nano Banana ProFlux 3 Image
1$0.025$0.16$0.088
12, the batch above$0.30$1.92$1.056
100$2.50$16.00$8.80

On Frameport Image 1, each reference after the first adds a small fee to every image, so the batch above, with two references, costs a little more than its row; a quote's breakdown itemizes it. The aspect ratio and the prompt do not change the price. Images are paid from a prepaid balance (pricing), and you can try Frameport Image 1 in the Studio before scripting a set.

Dark fantasy and horror are fiction like any other. Third-party models keep their makers' policies and may refuse a request, which then costs nothing. On every model, the acceptable use policy rules out anything involving minors, real identifiable people without their consent, and anything illegal.

To see what costs nothing while you set the pipeline up, read the free image generation API guide.

FAQ

What is an AI game assets generator API?

An API that turns text, and optionally reference pictures, into game art: concept art, item icons, props, textures and key art. Here, each asset is an image request, and a script can generate a whole list in one style.

Can it make sprites with a transparent background?

Not directly: the images come back flat. Ask for a plain, flat background in the prompt, then remove it with your own tool, and assemble sprite sheets the same way.

How do I keep the same art style across all assets?

Repeat one style line word for word in every prompt, stage each family of assets the same way, and send a few approved assets as style references on a model that reads them, such as Frameport Image 1.

Is there a free AI game asset generator?

The account, the API key and quotes are free, and an image that fails costs nothing. Images are paid from a prepaid balance, from $0.025 on Frameport Image 1.

Can I use AI-generated game assets commercially?

Our Terms say you keep the rights you have in your prompts, pictures and outputs, as far as the law and the terms of the model's maker allow, and that you answer for how you use them. Read each maker's current terms, check what your store asks you to disclose about AI content, and ask a lawyer when it matters.

Start building.

Your API key is free. Top up from $10 when you are ready.