Design-time image generation
Use the CLI when you are making assets for a game during development. Use the runtime image generation API when a running game needs to generate or transform images for a player.
Need the CLI first? Install it and sign in from Install & update and Auth & setup.
CLI output is local. rundot generate image downloads a PNG and writes a <output>.json sidecar with the generation ID, prompt, resolved model, seed, and hosted image URL. It does not add the file to your build or upload it to player file storage. Put the output under your asset folder and commit or deploy it like any other local asset.
Pick the environment and billing scope
rundot generate image uses the active CLI environment from rundot set-env. The command does not take --env.
rundot set-env prod
rundot generate image --prompt "cozy shop interior, hand-painted game background" --out assets/shop.pngGame scope is optional:
Pass
--game-id <id>to charge and gate the request as that game's owner.Omit
--game-idinside a configured game directory to let the CLI readgame.config.<active-env>.json.Omit it outside a game directory to use gameless generation, which charges the authenticated creator instead of a game's owner.
That last mode is useful for concept art. Use a game scope when you need creator-storage file keys or want the same tier gates the game will face.
Generate an image
Prompt is required. Use --out when you want a stable filename. Without it, the CLI derives a slug from the prompt.
rundot generate image \
--prompt "wide pixel-art forest village background, morning fog" \
--aspect-ratio 16:9 \
--out assets/bg-forest-village.pngCommon dials:
--modelchooses a model. The default isgemini-3.1-flash-image-preview.--negative-promptadds things to avoid.--seedhelps reproduce a result.--remove-backgroundruns background removal after generation. Tune it with--remove-background-model birefnet,--remove-background-variant, and--remove-background-resolution.--image-size 1K|2K|4Konly works with--model gemini-3-pro-image-preview. Other models reject it. The Pro model uses Power image access when a game scope is present.
Discover models with:
This lists models for your authenticated creator and the current environment's credentials. It does not pass a game ID, so it is not a guarantee that a specific game can call the same set. For unbilled game-scoped availability, use runtime listModels() from the game context. rundot generate estimate image --game-id <id> is pricing-only: it can quote a Power model that the game still cannot use.
Reference images
Use --reference-image to steer composition or style. Repeat it up to 10 times.
Accepted inputs:
Local image files, max 10 MB each. The CLI inlines them into the request.
https://URLs.data:URIs.Creator-storage file keys, but only with a game scope.
http:// reference URLs are rejected. Use HTTPS.
Edit existing images
rundot image edit applies a text instruction to one or more input images. It is CLI-only. There is no SDK method for image editing.
Current restrictions:
Hidden unless
RUNDOT_BETA_FEATURES=1is set.Prod only. Use
--env prodor switch withrundot set-env prod.Requires interactive
rundot login.rk_API-key sessions are rejected, even when you pass--game-id.Accepts up to 10 inputs. Local files are limited to 10 MB each and about 24 MB total after base64 encoding.
--image-sizeaccepts1Kor2K. There is no 4K edit mode.image edituses a Power image-edit model. With--game-id, the game owner's access still has to allow that class.Local files and HTTPS inputs work without a game. Creator-storage file keys need
--game-idor a local game config.Existing outputs are not overwritten unless you pass
--forceor confirm interactively.
If you omit --out, local input hero.png writes hero_edit.png. URL inputs write output_edit.png.
Related transforms
These commands also download local files. They are prod-only and require interactive login, but depth, remove-bg, and upscale are visible in normal help.
rundot image turnaround is beta-hidden like image edit:
Estimate before you generate
Use estimates instead of copying price tables into scripts or docs.
The estimate comes from the same /v1/credits/estimate endpoint the platform uses for current pricing. It is exact when RUN controls the final charge. Use --json when a script needs the number.
Estimates do not check model availability or generation policy. With --game-id, the quote uses that game's owner/platform billing and markup rules, but a later generation with the same flags can still be rejected by the game owner's model gates or provider availability.
Billing follows the scope:
Game-scoped generation bills the game's owner.
Gameless generation bills the signed-in creator.
Platform-owned or platform-funded calls may omit a visible
creditsblock because no creator wallet was charged.
For in-game calls, read credits on the runtime API and Credits.
Last updated