Asset Generation Guide

Learn how to author your story in a workspace and generate AI assets with Afila.

Getting Started

Afila generates AI images and videos from YAML specs stored in a workspace. The process works in three steps:

  1. Create a workspace on the Workspaces page
  2. Describe your story to the assistant, or edit the character, still, and scene YAML files yourself
  3. Click Generate assets in the workspace

Generated assets are stored in the cloud and linked from the status block of each YAML file, which is updated in place in your workspace.

Workspaces

A workspace is a private collection of YAML files for one story. You can create as many as you like, rename them, and delete them from the Workspaces page. Files are stored privately in your account and are never publicly accessible; only the generated images and videos are served from public storage.

Each workspace shows three panes side by side: the file list, an editable YAML pane, and the assistant. When the assistant writes a file, the YAML pane updates live. Edits you make are validated before saving, and if a file changed elsewhere while you were editing, you are asked to reload it.

Generation writes results back into the same YAML files (status block) so re-runs skip finished assets. Workspace files are overwritten in place; there is no version history.

Folder Structure

Files in a workspace live under a .afila/directory with the following structure:

Workspace layout
workspace/
├── .afila/
│   ├── characters/
│   │   ├── hero.yaml
│   │   ├── villain.yaml
│   │   └── sidekick.yaml
│   ├── stills/
│   │   ├── park-adventure.yaml
│   │   └── battle-moment.yaml
│   ├── scenes/
│   │   ├── opening.yaml
│   │   ├── confrontation.yaml
│   │   └── finale.yaml
│   ├── voices/              (optional)
│   │   └── hero-voice.yaml
│   ├── sources/             (optional, imported videos to edit)
│   │   └── my-video.yaml
│   └── films/               (optional)
│       └── trailer.yaml
└── ...

Generated assets (images, videos) are stored in the cloud. Each YAML file's status.reference field will contain the URL to the generated asset after generation completes.

Character File Schema

Each YAML file in .afila/characters/ defines a character that will be used to generate a reference image. The filename (without extension) is used as the default character name.

.afila/characters/hero.yaml
type: character
metadata:
  name: Hero                        # Defaults to the filename; letters, digits, - and _ only, max 30

spec:
  dataPrompt: >
    A young woman with silver hair and violet eyes,
    wearing a flowing blue cloak over leather armor,
    standing in a heroic pose, plain neutral studio background,
    no text or logos on clothing, fantasy art style
  dataPromptNegative: >
    blurry, low quality, deformed, extra limbs, text, watermark

  # Optional: a reusable voice from .afila/voices/ (see Voice File Schema)
  # voice: hero-voice

# Status — managed by Afila (do not edit manually)
# status:
#   success: true
#   reference: https://afilastore.blob.core.windows.net/assets/.../Hero.jpg
#   generatedTime: "2025-04-19T08:30:00.000Z"

Field Reference

FieldTypeRequiredDescription
metadata.namestringYesCharacter name. Defaults to the filename if omitted. Must be alphanumeric (hyphens and underscores allowed), no spaces, max 30 characters.
spec.dataPromptstringYesPrompt describing the character's appearance for image generation.
spec.dataPromptNegativestringNoNegative prompt — things to avoid in the generated image.
spec.voicestringNoName of a voice in .afila/voices/. Scenes that use this character reuse that voice so it sounds the same every time. Without it, the voice comes from the scene prompt.
statusobjectNoManaged by Afila. Tracks generation state including the URL to the generated asset. If status.success is true, the character is skipped on subsequent runs.
Tip: Be descriptive in your prompts. Include art style, clothing details, pose, and quality modifiers for best results. Ask for a plain neutral background and no text or logos on clothing so the character is easy to reuse across scenes.

Still File Schema

Each YAML file in .afila/stills/ defines a still image for high-quality AI image generation. Like scenes, stills can reference characters using @characterName in prompts — the character's generated image is automatically passed as a reference.

.afila/stills/park-adventure.yaml
type: still
metadata:
  name: park-adventure

spec:
  dataPrompt: >
    @Hero and @Sidekick running through a sunny park
    with tall oak trees, autumn leaves swirling in the air,
    warm golden hour lighting, ligne claire cartoon style

  dataPromptNegative: >
    blurry, low quality, deformed, realistic, dark

  # Generation options
  options:
    outputFormat: png               # jpg, png, or webp (default: png)
    aspectRatio: "16:9"             # see options table below

# Status — managed by Afila (do not edit manually)
# status:
#   success: true
#   reference: https://afilastore.blob.core.windows.net/assets/.../park-adventure.png
#   generatedTime: "2025-05-12T08:30:00.000Z"

Field Reference

FieldTypeRequiredDescription
metadata.namestringYesStill name. Defaults to filename. Must be alphanumeric (hyphens and underscores allowed), no spaces, max 30 characters.
spec.dataPromptstringYesPrompt describing the image to generate. Use @characterName to reference characters.
spec.dataPromptNegativestringNoNegative prompt — things to avoid in the generated image.
spec.optionsobjectNoGeneration settings: outputFormat, aspectRatio.
statusobjectNoManaged by Afila. Tracks generation state. Completed stills are skipped on re-runs.

Options Reference

OptionDefaultValues
outputFormatpngjpg, png, webp
aspectRatio16:91:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3
Note: Stills are always generated at 2K resolution for optimal quality. Use @characterName references in your prompt to include character images as visual references for the AI.

Scene File Schema

Each YAML file in .afila/scenes/ defines a scene for video generation. Characters are automatically detected from @characterName references in prompts and used as visual references. Audio (dialogue, sound effects, ambient sound) is always generated.

.afila/scenes/park-meeting.yaml
type: scene
metadata:
  name: park-meeting

spec:
  dataPrompt: >
    @Hero meets @Sidekick in a sunny park,
    warm afternoon light, birds singing
  dataPromptNegative: dark, rainy, scary

  # Optional: open with the last frame of an earlier scene (continuous action)
  # continuesFrom: previous-scene

  # Optional keyframes (names of characters or stills)
  keyframes:
    first: park-still
    last: Hero

  # Shots — compiled into one timed prompt (total duration = sum, 2–30s)
  shots:
    - name: wide-shot
      dataPrompt: >
        Wide shot of a sunny park with a wooden bench,
        SFX: birds chirping, gentle breeze rustling leaves
      dataPromptNegative: ""
      duration: 5

    - name: meeting
      dataPrompt: >
        @Hero spots @Sidekick on the bench and runs over,
        @Hero says excitedly "There you are!",
        @Sidekick barks happily,
        SFX: footsteps on grass, joyful barking
      dataPromptNegative: ""
      duration: 5

  # Generation options
  options:
    duration: 10                    # 2–30 seconds (ignored when shots are used)
    aspectRatio: "16:9"             # 16:9, 9:16, 4:3, 3:4, 1:1 or 21:9
    resolution: 1080p               # 480p, 720p, 1080p (default)

Field Reference

FieldTypeRequiredDescription
namestringYesScene name. Defaults to filename. Alphanumeric, hyphens, underscores, max 30 characters.
dataPromptstringYesOverall scene description. Use @characterName to reference characters (max 4). Ignored when shots are used.
dataPromptNegativestringNoNegative prompt for things to avoid.
shotsarrayNoIndividual video segments. Each has name, dataPrompt, and duration (seconds). The total (2–30s) becomes the scene duration. Shot timing is a guide rather than a guaranteed cut.
optionsobjectNoGeneration settings: duration, aspectRatio, resolution.
statusobjectNoManaged by Afila. Tracks generation state. Completed scenes are skipped on re-runs.

Options Reference

OptionDefaultValues
duration102–30 seconds (ignored when shots are used)
aspectRatio16:916:9, 9:16, 4:3, 3:4, 1:1, 21:9
resolution1080p480p, 720p, 1080p

Constraints

• Scene duration: 2–30 whole seconds, generated in one pass

• A last keyframe switches to strict first/last-frame mode: the scene prompts cannot use @name references

• Maximum 10 images (characters/stills) per scene. Describe voices and dialogue in the prompt; optionally define a reusable voice (.afila/voices/ + character spec.voice) to keep a character's voice consistent

• @name can reference characters and stills; keyframes names must match a character or still

• continuesFrom: scene-name opens a scene with the last frame of an earlier scene (uses one image slot; not combinable with keyframes.first; the earlier scene must be generated first). Scenes run in filename order, so use s001--style names

• edit replaces or adds characters in an existing 2–10s video: source.scene (a scene, generated first) or source.url (public mp4/mov, also set options.duration and options.aspectRatio), replace: [{target, with}], add: [{character, where, action}], optional keep. Up to 4 character images, 720p or 1080p; not combinable with shots, keyframes or continuesFrom

• Characters and stills referenced with @name are passed to the video as reference images automatically; names are case-insensitive

• At most 3 characters with a voice per scene. Scenes in a film must all share one aspect ratio and resolution

Audio Tips

Audio is always generated. You can direct the soundscape in your prompts:

• Dialogue: Use quotes — @Hero says "Let's go!"

• Sound effects: Use SFX: prefix — SFX: thunder cracks, rain on roof

• Ambient sound: Describe the soundscape — quiet forest ambiance, distant river

Voice File Schema (optional)

Voices are never required. By default a character's voice comes from the scene prompt (for example @Hero, bright young warm voice, says: "…"). For long or multi-scene stories where a character must sound identical every time, define a voice in .afila/voices/ and point a character at it.

.afila/voices/hero-voice.yaml
type: voice
metadata:
  name: hero-voice

spec:
  # Generated once from this description (about 3 credits)
  description: A bright, warm, curious young woman's voice, clear and energetic
  sampleLine: Hello there, it is good to finally meet you.   # optional, max 12 words

  # Or skip generation and supply your own 1–5s sample (wav or mp3, public https URL)
  # audioUrl: https://example.com/hero-voice.mp3

# status is managed by Afila
.afila/characters/hero.yaml (excerpt)
spec:
  dataPrompt: ...
  voice: hero-voice

• In a workspace, Character from video lets you upload or record a 3–10s clip of yourself and creates a matching character and voice in one step (use only your own likeness or with permission). Add voice uploads an mp3 or wav sample (1–15s) as the voice and can attach it to a character.

• A voice needs a description (to generate the sample), an audioUrl (your own sample, which costs nothing) or a fromSource (a 3–15s clip of an imported video, free; give start and end, or omit both to auto-pick speech).

• A character can also use spec.fromSource: {source, time} to base its portrait on a frame of an imported video (use only videos you have the rights to). Ask your agent for suggested frames and clips with afila_suggest_subject.

• Generated voices are created before characters, stills and scenes, then reused by every scene that features the character.

• A scene supports at most 3 characters with a voice. Keep uploaded samples short (1–5s).

• If a voice cannot be generated, scenes still run and fall back to the voice described in their prompt; the error is reported in the job.

• spec.voices inside a scene is not supported; attach voices through characters.

Film File Schema (optional)

A film joins generated scenes, in order, into one finished video. It costs no credits.

.afila/films/trailer.yaml
type: film
metadata:
  name: trailer

spec:
  scenes:
    - s001-opening                       # plain name = hard cut
    - s002-chase
    - scene: s003-finale                 # crossfade into this scene
      transition: crossfade
      transitionSeconds: 0.5             # default 0.5, max 1
  fadeIn: 1                              # optional, seconds (max 3)
  fadeOut: 1.5                           # optional, seconds (max 3)

# status is managed by Afila; status.reference is the finished video

• Up to 50 scenes, each listed once. Every scene must exist and share the same aspectRatio and resolution.

• transition is how a scene joins the previous one (cut or crossfade); the first scene has none. A crossfade must be shorter than both scenes. Use cuts between scenes linked with continuesFrom, since their frames already match.

• The film is built after the scenes. If any listed scene is not generated, the film is skipped and reported as an error: generate the missing scenes and run again.

• A finished film is not rebuilt. To restitch it (for example after regenerating a scene), remove its status block.

Running Generation

Once your workspace contains .afila/ files:

  1. Open the workspace from the Workspaces page
  2. Click "Generate assets"
  3. Monitor progress in the workspace header, or on the Jobs page

What happens during generation

1. The workspace YAML is loaded

2. Optional voices without a sample are generated first, then character YAML files are parsed and images are generated (1 credit per image)

3. Still YAML files are parsed and high-quality images are generated (2 credits per still)

4. Scene YAML files are parsed and scenes are generated (billed per second, depending on resolution)

5. Optional films stitch the generated scenes into one video (free). Generated assets are uploaded to cloud storage

6. YAML files are updated with status fields

7. Updated YAML is saved back to your workspace

Re-runs are incremental: Voices, characters, stills, scenes, and films with status.success: true are automatically skipped. To regenerate an asset, remove the status block from its YAML file.

Connect an AI Agent (MCP)

Afila runs a hosted Model Context Protocol (MCP) server, so an AI agent can turn a screenplay or story into .afila/ files, validate them, and run generation for you. Nothing to install: add the URL, sign in once in your browser, and approve access.

MCP server URL
https://api.afila.fyi/mcp

Install the plugin (skills + MCP server)

The quickest way: one plugin that bundles the screenplay and generation skills with the MCP server.

Copilot CLI
copilot plugin marketplace add afila-fyi/afila
copilot plugin install afila@afila
Claude Code
/plugin marketplace add afila-fyi/afila
/plugin install afila@afila

Or add only the MCP server

VS Code / GitHub Copilot (.vscode/mcp.json)
{
  "servers": {
    "afila": { "type": "http", "url": "https://api.afila.fyi/mcp" }
  }
}
Copilot CLI (~/.copilot/mcp-config.json)
{
  "mcpServers": {
    "afila": { "type": "http", "url": "https://api.afila.fyi/mcp", "tools": ["*"] }
  }
}
Claude Code
claude mcp add --transport http afila https://api.afila.fyi/mcp

The first time the agent connects, your browser opens an Afila sign-in page. Enter your email, type the 4-digit code we send you, then choose Approve. The agent stays connected and refreshes access automatically; you can deny or revoke access any time by removing the server from your agent.

Available tools

afila_get_authoring_guideRules, limits, templates and the full procedure for turning a screenplay or story into Afila files
afila_validate_projectChecks .afila YAML contents with the same rules generation uses and estimates credits. Free; nothing is stored
afila_get_balanceYour current credit balance
afila_submit_jobStarts generation for a workspace
afila_get_job / afila_list_jobsJob status and progress
afila_wait_for_jobWaits up to ~50s per call; the agent calls it until the job finishes
afila_workspace_list / afila_workspace_createList your workspaces or create a new one
afila_workspace_list_files / afila_workspace_read_fileBrowse and read the YAML files in a workspace
afila_workspace_write_files / afila_workspace_delete_fileCreate, update or delete workspace YAML files
afila_validate_workspaceValidate every file in a workspace and estimate credits
afila_suggest_subjectSuggest frames and speech clips of an imported video for a character and voice

Screenplay to assets

  1. Give the agent your screenplay or story and the workspace to use (or ask it to create one).
  2. The agent breaks it into characters, stills and scenes and writes the .afila/ files into the workspace.
  3. It validates them and tells you the credit estimate and your balance.
  4. After you confirm, it submits the job, then reports progress until the assets are ready.
  5. Each YAML in the workspace is updated with its asset link.
Only one job per account can run at a time.

Large screenplays & continuity

• Every scene renders independently, so continuity is designed per cut: continuesFrom for continuous action, a location still as keyframes.first for hard cuts or new locations.

• Use one style line everywhere, name the character, outfit and location in every shot, and model wardrobe or time-of-day changes as separate characters/stills.

• Build a story bible and a continuity ledger first; generate all characters and location stills up front.

• Add one batch of sequences to the workspace at a time and review each result before the next; generated scenes that others continue from must be finished first.

• For consistent voices, paste a fixed voice phrase (gender, pitch, accent, pace) before every line of a character's dialogue, and repeat the same ambience phrase per location.

• Use zero-padded scene names (s001-…) since scenes run in filename order.

• Join the scenes into one video with a film (.afila/films/<name>.yaml): an ordered scenes list with optional per-scene transition: crossfade, plus fadeIn/fadeOut. Stitching is free, needs every scene to share one aspect ratio and resolution, and is skipped (with an error) if any listed scene is not generated.

Credit Costs

Asset TypeCost
Character image1 credit
Still image (2K)2 credits
Scene (1080p)12 credits per 5 seconds
Scene (720p)6 credits per 5 seconds
Scene (480p)3 credits per 5 seconds
Voice (optional, generated)3 credits (an uploaded sample is free)
Film (stitching scenes)Free
Each scene+0.5 credits (prompt, reference image overhead)

Credits never expire. Get started with 10 free credits, or purchase 100 credits for $9.99 from the Credits page.