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:
- Create a workspace on the Workspaces page
- Describe your story to the assistant, or edit the character, still, and scene YAML files yourself
- 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.
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/ ├── .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.
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
| Field | Type | Required | Description |
|---|---|---|---|
| metadata.name | string | Yes | Character name. Defaults to the filename if omitted. Must be alphanumeric (hyphens and underscores allowed), no spaces, max 30 characters. |
| spec.dataPrompt | string | Yes | Prompt describing the character's appearance for image generation. |
| spec.dataPromptNegative | string | No | Negative prompt — things to avoid in the generated image. |
| spec.voice | string | No | Name 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. |
| status | object | No | Managed by Afila. Tracks generation state including the URL to the generated asset. If status.success is true, the character is skipped on subsequent runs. |
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.
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
| Field | Type | Required | Description |
|---|---|---|---|
| metadata.name | string | Yes | Still name. Defaults to filename. Must be alphanumeric (hyphens and underscores allowed), no spaces, max 30 characters. |
| spec.dataPrompt | string | Yes | Prompt describing the image to generate. Use @characterName to reference characters. |
| spec.dataPromptNegative | string | No | Negative prompt — things to avoid in the generated image. |
| spec.options | object | No | Generation settings: outputFormat, aspectRatio. |
| status | object | No | Managed by Afila. Tracks generation state. Completed stills are skipped on re-runs. |
Options Reference
| Option | Default | Values |
|---|---|---|
| outputFormat | png | jpg, png, webp |
| aspectRatio | 16:9 | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3 |
@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.
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
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Scene name. Defaults to filename. Alphanumeric, hyphens, underscores, max 30 characters. |
| dataPrompt | string | Yes | Overall scene description. Use @characterName to reference characters (max 4). Ignored when shots are used. |
| dataPromptNegative | string | No | Negative prompt for things to avoid. |
| shots | array | No | Individual 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. |
| options | object | No | Generation settings: duration, aspectRatio, resolution. |
| status | object | No | Managed by Afila. Tracks generation state. Completed scenes are skipped on re-runs. |
Options Reference
| Option | Default | Values |
|---|---|---|
| duration | 10 | 2–30 seconds (ignored when shots are used) |
| aspectRatio | 16:9 | 16:9, 9:16, 4:3, 3:4, 1:1, 21:9 |
| resolution | 1080p | 480p, 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.
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
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.
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:
- Open the workspace from the Workspaces page
- Click "Generate assets"
- 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
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.
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 plugin marketplace add afila-fyi/afila copilot plugin install afila@afila
/plugin marketplace add afila-fyi/afila /plugin install afila@afila
Or add only the MCP server
{
"servers": {
"afila": { "type": "http", "url": "https://api.afila.fyi/mcp" }
}
}{
"mcpServers": {
"afila": { "type": "http", "url": "https://api.afila.fyi/mcp", "tools": ["*"] }
}
}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_guide | Rules, limits, templates and the full procedure for turning a screenplay or story into Afila files |
| afila_validate_project | Checks .afila YAML contents with the same rules generation uses and estimates credits. Free; nothing is stored |
| afila_get_balance | Your current credit balance |
| afila_submit_job | Starts generation for a workspace |
| afila_get_job / afila_list_jobs | Job status and progress |
| afila_wait_for_job | Waits up to ~50s per call; the agent calls it until the job finishes |
| afila_workspace_list / afila_workspace_create | List your workspaces or create a new one |
| afila_workspace_list_files / afila_workspace_read_file | Browse and read the YAML files in a workspace |
| afila_workspace_write_files / afila_workspace_delete_file | Create, update or delete workspace YAML files |
| afila_validate_workspace | Validate every file in a workspace and estimate credits |
| afila_suggest_subject | Suggest frames and speech clips of an imported video for a character and voice |
Screenplay to assets
- Give the agent your screenplay or story and the workspace to use (or ask it to create one).
- The agent breaks it into characters, stills and scenes and writes the
.afila/files into the workspace. - It validates them and tells you the credit estimate and your balance.
- After you confirm, it submits the job, then reports progress until the assets are ready.
- Each YAML in the workspace is updated with its asset link.
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 Type | Cost |
|---|---|
| Character image | 1 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.