Skip to content

Generation

A row of images: a painted jungle scene with a stone head, a picture of the stone head alone, four views of the finished 3D model, and the model beside a small wooden figure

From picture to model, for a jungle statue on Crescent Lagoon. Left to right: the picked concept, the reference view, the resulting model from four sides, the model beside a 1.4 m figure. A generated model still goes through the model gate.

Skills and agents never name a product. They call one of four tools by a fixed name, and you decide what runs behind each name.

Tool Does Output
image-gen text to image: concept art, references, texture sheets PNG
image-edit text plus reference images to image: keep a style, object or outfit PNG
image-to-3d one image, or front, left, back and right views, to a model GLB
blender runs a Python script in headless Blender whatever the script writes

The commands

python .omp/scripts/tool.py image-gen  --prompt-file p.txt --aspect landscape --output out.png
python .omp/scripts/tool.py image-edit --prompt-file p.txt --reference lock1.png --reference lock2.png --output out.png
python .omp/scripts/tool.py image-to-3d --image front.png --faces 8000 --output prop.glb
python .omp/scripts/tool.py image-to-3d --front f.png --left l.png --back b.png --right r.png --output prop.glb
python .omp/scripts/tool.py blender --script build.py [--blend file.blend] -- <script args>
python .omp/scripts/tool.py check            # what is configured, and does it answer
Flag Meaning
--prompt or --prompt-file the prompt, inline or from a file
--aspect square, landscape (3:2), portrait (2:3), wide (16:9), tall (9:16) or WIDTHxHEIGHT
--quality low, medium or high
--transparent PNG alpha, where the backend supports it
--reference a reference image for image-edit. Repeatable, order matters
--faces the face limit for image-to-3d
--resume a task id printed by an earlier run: download it instead of paying again
--output the file to write
--backend <name> use only this backend from the config
--dry-run show which backend would run with what request, and call nothing
--approve-spend you approved this paid generation

Standard output is one JSON object. Its backend field says which backend produced the file.

Exit codes

flowchart LR
    run[tool.py runs] --> e0[0: done, file at output]
    run --> e1[1: every backend failed]
    run --> e2[2: usage or config error]
    run --> e3[3: hand-off]
    run --> e4[4: needs your approval to spend]
    e3 --> h1[handoff: agent<br/>the agent calls its own tool]
    e3 --> h2[handoff: user<br/>you make it by hand]
    e4 --> ap[you approve, then the agent<br/>re-runs with --approve-spend]
Exit Meaning What the agent does
0 done, file at output inspects the result
1 every backend failed reports it. It does not silently switch tools
2 usage or config error fixes the call or the config
3 hand-off. handoff: agent: the agent calls one of its own tools with the request. handoff: user: you make it by hand, and how says where does it, and saves to output
4 the backend spends money and needs approval asks you to approve this generation, then re-runs with --approve-spend

Exit 4 is how you keep control of cost. Set confirm_spend: true on a backend, and it stops with exit 4 until you approve each generation.

Exit 3 is how a tool you already pay for elsewhere can be used: a web studio on a subscription, or an image tool built into your agent host.

Choosing backends

A backend is the service or program that does the work. Your choice lives in local/tools.json, which is yours and is not part of the kit repository. The template is local.example/tools.json.

Each tool takes a list. The first backend that works is used, so put the best one you pay for first and a free one after it.

Tool Paid backends Free fallback
image-gen openai, gemini, an agent hand-off, a subscription command-line program (command) comfyui on a local graphics card
image-edit openai, gemini, an agent hand-off comfyui on a local graphics card
image-to-3d tripo, meshy, an agent hand-off, a web studio by hand (manual) a local model through command
blender none Blender 4.2 or newer

Backend types: openai, gemini, comfyui, tripo, meshy, command, agent, manual, blender.

Blender runs without a window

The blender tool runs:

blender -b --factory-startup [file.blend] --python <script> -- <args>

That is background mode, with no window and third-party add-ons off. Every Blender step in the kit runs this way, including the model gate.

Check your setup

python .omp/scripts/tool.py check

It prints what is configured and whether each backend answers.

Keys, models and every backend field are in docs/tools.md.