/\ ATFGraph /docs
README Downloads
Examples / ATFGraph
Framework reference

This article is retained from the existing framework docs. Self-hosting commands and server-admin access differ from the managed CLI workflow. Start with Get started for the installed product.

Image studio

Directory examples/python/image_studio

This example expands a prompt into typed instructions, then calls an image provider. Prepare the SDK and CLI from the repository root:

Agent node label image-studio, version 1.0.0.

Capabilities

CapabilityKindSignatureModuleSummary
create_prompttraversal(topic: str) -> dictexamples/python/image_studio/agent.py
generate_artworktraversal(topic: str, size: str = '1024x1024', model: str | None = None) -> dictexamples/python/image_studio/agent.py
generate_imagetraversal(prompt: str, size: str = '1024x1024', model: str | None = None) -> dictexamples/python/image_studio/agent.py

Commands

Taken from this example's own README and module docstrings.

atfg server start
atfg traverse image-studio.generate_artwork --in '{"topic":"An amber compass beside a travel journal","size":"1024x1024"}'
cargo build --bin atfgraphd --bin atfg
python -m atfgraph.worker --module examples.python.image_studio.agent:app
python -m examples.python.image_studio.call create_prompt '{"topic":"A quiet Bali beach at dawn"}'
python -m pip install -e ./python

Files

  • examples/python/image_studio/README.md
  • examples/python/image_studio/__init__.py
  • examples/python/image_studio/agent.py
  • examples/python/image_studio/agentnode.yaml
  • examples/python/image_studio/call.py
  • examples/python/image_studio/requirements.txt

README

Rendered from examples/python/image_studio/README.md; the source file is not modified.

This example expands a prompt into typed instructions, then calls an image provider. Prepare the SDK and CLI from the repository root:

python -m pip install -e ./python
cargo build --bin atfgraphd --bin atfg
export PATH="$PWD/target/debug:$PATH"
atfg server start

The default server is http://127.0.0.1:18880, with its Console at /ui/. Set server URL/key variables when connecting elsewhere.

Configure the prompt-expansion model through ATFGRAPH_MODEL_URL, ATFGRAPH_MODEL_NAME and its key. Set IMAGE_MODEL and the image provider's credential, such as OPENAI_API_KEY. Running the generation path can incur both chat and image charges.

python -m atfgraph.worker --module examples.python.image_studio.agent:app
# Another terminal:
atfg traverse image-studio.generate_artwork --in '{"topic":"An amber compass beside a travel journal","size":"1024x1024"}'
python -m examples.python.image_studio.call create_prompt '{"topic":"A quiet Bali beach at dawn"}'

Inspect two child steps: prompt expansion and image creation. The result includes the prompt, style notes, selected model, output URLs and any saved inline-image paths. ATFGRAPH_MEDIA_DIR chooses worker-local storage, defaulting to /tmp/atfgraph-image-studio. URL outputs are not downloaded automatically, and saved paths refer to the worker host. Select a supported model/size. Generation requires live provider access; errors do not produce fake artwork.

ATFGraph documentationHosted workflow · Framework reference