A Claude Code plugin that turns a story into a finished anime
Ruby
use gpt 2.6 as default
Francesco 'makevoid' Canessaa906ca315a17
diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex 8b8abc5..0c66292 100644--- a/.claude-plugin/plugin.json+++ b/.claude-plugin/plugin.json@@ -2,7 +2,7 @@"name": "make-an-anime","version": "0.4.0","license": "MIT",- "description": "Create anime from a story: character sheets (GPT Image 2.5 Sunburst), cinematic MiniMax H3 shots, green-screen layered composites, ElevenLabs v4 character voices, ElevenLabs Music v2.5 scores, p5 titles and subtitles, SFX and Swift VFX. Works from a 12-second scene to a full episode.",+ "description": "Create anime from a story: character sheets (GPT Image 2.6 Sunburst), cinematic MiniMax H3 shots, green-screen layered composites, ElevenLabs v4 character voices, ElevenLabs Music v2.5 scores, p5 titles and subtitles, SFX and Swift VFX. Works from a 12-second scene to a full episode.","author": {"name": "makevoid","url": "https://github.com/makevoid"diff --git a/README.md b/README.mdindex 79fc33f..c3da062 100644--- a/README.md+++ b/README.md@@ -75,9 +75,9 @@ Each stage reads prompts from `prompts/<run>/` and writes to `output/<run>/`, so<img src="https://github.com/user-attachments/assets/2f8d9c6d-0b09-4e4f-aa25-ce396cb5acaa" alt="One shot of Too Salty at four stages: the character sheet, the painted keyframe, a frame of the animated take, and the finished frame with subtitles" width="100%">-1. **Character and location sheets.** A style bible (`config/style.md`) goes into every prompt, so the whole cast shares one look. GPT Image 2.5 draws a sheet for each character and location, and those sheets become the references for everything after.+1. **Character and location sheets.** A style bible (`config/style.md`) goes into every prompt, so the whole cast shares one look. GPT Image 2.6 draws a sheet for each character and location, and those sheets become the references for everything after.2. **Voices and score.** Each character gets one ElevenLabs voice in `config/cast.yml`. Voices come before animation because line lengths decide shot lengths. ElevenLabs Music then composes one score, and `gen:mix` ducks it under the voices.-3. **Keyframes.** GPT Image 2.5 paints the first frame of each shot from the sheets.+3. **Keyframes.** GPT Image 2.6 paints the first frame of each shot from the sheets.4. **Shots.** MiniMax H3 animates each keyframe as one continuous take, with the camera move written into the prompt and the speaker's voice as target audio so the mouth follows the line. Held stills and colour inserts cost nothing. For moments that need exact placement, [layered scenes](skills/make-an-anime/references/layered-scenes.md) composite green-screen sprites over a painted plate.5. **Overlay.** A p5 script (`05_overlay.js`) draws titles, subtitles, fades and any composite work.6. **Sound.** `sfx:gen` creates sound effects with Stable Audio, and `sfx:mix` places them from a cue list and levels them against the mix.@@ -185,7 +185,7 @@ https://github.com/user-attachments/assets/638400e6-5f41-445d-b2cd-281a6d3dcd3b### Character sheets-GPT Image 2.5 draws a turnaround and expressions for each character. Every later image and take uses these sheets as references, which keeps the characters on-model from shot to shot.+The image model draws a turnaround and expressions for each character. Every later image and take uses these sheets as references, which keeps the characters on-model from shot to shot.**The Last One:** Mio and Harudiff --git a/skills/make-an-anime/SKILL.md b/skills/make-an-anime/SKILL.mdindex a3f832a..ce65982 100644--- a/skills/make-an-anime/SKILL.md+++ b/skills/make-an-anime/SKILL.md@@ -1,6 +1,6 @@---name: make-an-anime-description: Create and revise anime, from a 12-second battle scene to full episodes and narrated documentaries, from a story and optional character reference photos. Character and location sheets with GPT Image 2.5 Sunburst xhigh, cinematic camera-directed shots animated with MiniMax H3 Max with characters and world painted together, manga paper-cut panels, a distinct ElevenLabs Eleven v4 voice per character with lip-sync, ElevenLabs Music v2.5 scores, p5 screens/titles/subtitles, SFX and Swift VFX. Use for whole episodes, pilots, single scenes, or revisions to their cast, voices, shots, sound and effects.+description: Create and revise anime, from a 12-second battle scene to full episodes and narrated documentaries, from a story and optional character reference photos. Character and location sheets with GPT Image 2.6 Sunburst, cinematic camera-directed shots animated with MiniMax H3 Max with characters and world painted together, manga paper-cut panels, a distinct ElevenLabs Eleven v4 voice per character with lip-sync, ElevenLabs Music v2.5 scores, p5 screens/titles/subtitles, SFX and Swift VFX. Use for whole episodes, pilots, single scenes, or revisions to their cast, voices, shots, sound and effects.license: MITcompatibility: Designed for Claude Code. Requires Ruby 3.2+, Bundler, web search and sub-agent tools. Media tasks require FFmpeg, ImageMagick, Python 3, Node.js 22+ and Chrome. Swift VFX requires macOS 14+ and Swift 5.9+. Fal generation requires the plugin's sensitive FAL_AI_API_KEY option or that environment variable for local development.---@@ -53,7 +53,7 @@ Read [believable-motion.md](references/believable-motion.md), [production.md](reOrder of work, each step reviewed before the next:-1. **Character sheets** (`Steps::RefBase`): one run per character per age, e.g. `char-kaen-v1`. Original characters are text-to-image; for a real person add `photos:` and GPT Image 2.5 Sunburst **xhigh** edits them, **front-view photos first**, with a written face-anchor checklist (see "Getting the face right" in [prompts.md](references/prompts.md)). Locations that recur get location sheets the same way (text-to-image). `review:likeness[run,...]` puts sheets under the numbered photos; inspect the face first, then age, anatomy, outfit and style consistency across the whole cast; regenerate (new version) before anything depends on them. Lock accepted sheets.+1. **Character sheets** (`Steps::RefBase`): one run per character per age, e.g. `char-kaen-v1`. Original characters are text-to-image; for a real person add `photos:` and GPT Image 2.6 Sunburst edits them, **front-view photos first**, with a written face-anchor checklist (see "Getting the face right" in [prompts.md](references/prompts.md)). Locations that recur get location sheets the same way (text-to-image). `review:likeness[run,...]` puts sheets under the numbered photos; inspect the face first, then age, anatomy, outfit and style consistency across the whole cast; regenerate (new version) before anything depends on them. Lock accepted sheets.2. **Voices** (`Steps::Dialogue`): cast one distinct ElevenLabs Eleven v4 voice per character in `config/cast.yml`; generate the scene's lines; `review:dialogue` verifies each line with Whisper. Line timings set the shot lengths, so do this before animating, and run `dialogue:timeline` after any voice or shot change.3. **Score** (`Steps::Music` with `03_score.json`): ElevenLabs Music v2.5 composition plan whose chunks follow the scene's beats, instrumental, exactly scene length. Then `Steps::Mix` ducks it under the dialogue.4. **Keyframes** (`Steps::Keyframes`): one composed first frame per shot, edited from the cast/location sheets (`base: false`, `refs: [...]`).diff --git a/skills/make-an-anime/examples/shonen-battle/docs/PLAN.md b/skills/make-an-anime/examples/shonen-battle/docs/PLAN.mdindex 89dc5a4..a1b3303 100644--- a/skills/make-an-anime/examples/shonen-battle/docs/PLAN.md+++ b/skills/make-an-anime/examples/shonen-battle/docs/PLAN.md@@ -7,7 +7,7 @@ score is unbroken. Prices are not quoted here: check the fal.ai pages of each mo| Model | First pass | Retake ceiling || --- | --- | --- |-| GPT Image 2.5 Sunburst xhigh | 3 sheets + 4 keyframes = 7 images | 4 more |+| GPT Image 2.6 Sunburst | 3 sheets + 4 keyframes = 7 images | 4 more || MiniMax H3 Max 768P | 4 clips of 5 s = 20 s | 2 clips more || ElevenLabs Eleven v4 | 4 lines | 4 more || ElevenLabs Music v2.5 | 1 score of 12 s | 1 more |diff --git a/skills/make-an-anime/references/prompts.md b/skills/make-an-anime/references/prompts.mdindex 8065001..ebae772 100644--- a/skills/make-an-anime/references/prompts.md+++ b/skills/make-an-anime/references/prompts.md@@ -12,9 +12,9 @@ Do not instruct a generation model to browse: the coordinating agent researchesOne paragraph, pasted into every image and H3 prompt through `{{STYLE}}`. Define: medium (cel-shaded 2D TV anime, painted backgrounds), line (thin clean lineart, line weight on silhouettes), shading (one or two cel tones plus soft highlight), eyes and faces (proportion, how realistic), colour (palette anchors in hex for each recurring light: monitor glow, lamp, moonlight, golden hour), backgrounds (painted, detailed, depth haze), lighting (motivated sources, rim light), and what to avoid (3D render look, photorealism, chibi, text). Choose the look from the story and brief; keep it unchanged for the whole production so every scene cuts together.-## Character sheets from reference photos: GPT Image 2.5 Sunburst xhigh+## Character sheets from reference photos: GPT Image 2.6 Sunburst-`Steps::RefBase` with `photos:` sends the uploaded reference photos to `openai/gpt-image-2.5/sunburst/edit` (quality `xhigh`, 2752×1536). Structure of `01_ref_base.txt`:+`Steps::RefBase` with `photos:` sends the uploaded reference photos to `openai/gpt-image-2.6/sunburst/edit` (quality `high`, `reasoning_effort` `high`, 2752×1536). Structure of `01_ref_base.txt`:1. "Character design sheet for an anime production. Draw the person shown in the reference photos as an anime character, keeping their real likeness: …" then the likeness anchors you verified in the photos (face shape, hairline, eyebrows, eyes, nose, beard, glasses, colouring) and the age at this point in the story.2. `{{STYLE}}`@@ -114,4 +114,4 @@ If a take drifts off-model, reduce motion, shorten the shot or add an `end_imageFetch `openapi:fetch` and read `openapi:summary`. The wrappers validate known properties/enums/ranges. Add any other Fal model as a Ruby `Fal::Models::Base` subclass, then a service/task. Do not call an SDK or curl directly. Do not silently substitute a model or quality setting.-Official sources: [H3 API](https://fal.ai/models/minimax/h3-max/image-to-video/api), [Sunburst generation](https://fal.ai/models/openai/gpt-image-2.5/sunburst/text-to-image/api), [Sunburst edit](https://fal.ai/models/openai/gpt-image-2.5/sunburst/edit/api), [ElevenLabs Eleven v4](https://fal.ai/models/elevenlabs/tts/eleven-v4/api), [ElevenLabs Music v2.5](https://fal.ai/models/elevenlabs/music/v2.5/api).+Official sources: [H3 API](https://fal.ai/models/minimax/h3-max/image-to-video/api), [Sunburst generation](https://fal.ai/models/openai/gpt-image-2.6/sunburst/text-to-image/api), [Sunburst edit](https://fal.ai/models/openai/gpt-image-2.6/sunburst/edit/api), [ElevenLabs Eleven v4](https://fal.ai/models/elevenlabs/tts/eleven-v4/api), [ElevenLabs Music v2.5](https://fal.ai/models/elevenlabs/music/v2.5/api).diff --git a/skills/make-an-anime/references/tasks.md b/skills/make-an-anime/references/tasks.mdindex 0895217..bb92968 100644--- a/skills/make-an-anime/references/tasks.md+++ b/skills/make-an-anime/references/tasks.md@@ -79,7 +79,8 @@ The music-video form remains available: song sections share one soundtrack.```ruby{- "char-singer-v1" => { steps: [Steps::RefBase], image_model: Fal::Models::GptImage25 },+ # image_model: and edit_model: pin another image model, e.g. Fal::Models::GptImage25 and Fal::Models::GptImage25Edit.+ "char-singer-v1" => { steps: [Steps::RefBase] },"ep01-s01" => {steps: [Steps::RefBase, Steps::Music, Steps::Keyframes, Steps::Clips, Steps::Overlay],import: { ref_base: "char-singer-v1" },diff --git a/skills/make-an-anime/references/testing.md b/skills/make-an-anime/references/testing.mdindex aeaef17..29421b7 100644--- a/skills/make-an-anime/references/testing.md+++ b/skills/make-an-anime/references/testing.md@@ -34,7 +34,7 @@ Live tests are excluded from routine runs. They require an explicit opt-in plusLIVE_FAL=1 LIVE_SONG=/absolute/short-song.wav LIVE_LYRICS='known sung words' PROFILE=live ruby scripts/mv.rb test```-Supply `FAL_AI_API_KEY` via the environment for this explicit developer CLI test. The plugin's sensitive key is scoped to its MCP server, which does not expose the live test runner. Budget per run: one Sunburst xhigh generation, one Sunburst xhigh edit, one five-second H3 768P clip (a harness-only saving; real projects keep the 1080P default), one Whisper transcription, one Demucs separation and one SFX generation. Local composition/VFX adds no model charges. No automatic paid rerolls. Run only after accepting those costs. Output is retained for inspection. A provider failure ends the test with request evidence; resume/recover before paying again.+Supply `FAL_AI_API_KEY` via the environment for this explicit developer CLI test. The plugin's sensitive key is scoped to its MCP server, which does not expose the live test runner. Budget per run: one Sunburst generation, one Sunburst edit, one five-second H3 768P clip (a harness-only saving; real projects keep the 1080P default), one Whisper transcription, one Demucs separation and one SFX generation. Local composition/VFX adds no model charges. No automatic paid rerolls. Run only after accepting those costs. Output is retained for inspection. A provider failure ends the test with request evidence; resume/recover before paying again.## Behavioral rehearsal for the Markdown workflowdiff --git a/skills/make-an-anime/scripts/lib/fal/models/gpt_image26.rb b/skills/make-an-anime/scripts/lib/fal/models/gpt_image26.rbnew file mode 100644index 0000000..3cf9968--- /dev/null+++ b/skills/make-an-anime/scripts/lib/fal/models/gpt_image26.rb@@ -0,0 +1,20 @@+require_relative "base"+require_relative "gpt_image25"++module Fal+ module Models+ # https://fal.ai/models/openai/gpt-image-2.6/sunburst/text-to-image+ # 2.6 has no xhigh quality: quality stops at high. Its schema also lists reasoning_effort xhigh and max, but on 2026-11-05+ # the API refused both with a 422 ("not supported for this image model"), so reasoning_effort stays at high.+ class GptImage26 < Base+ ENDPOINT = "openai/gpt-image-2.6/sunburst/text-to-image".freeze+ DEFAULTS = { quality: "high", reasoning_effort: "high", output_format: "png", num_images: 1 }.freeze+ SIZES = GptImage25::SIZES++ # Same signature as GptImage25#generate; this endpoint has no seed param.+ def generate(prompt:, aspect_ratio: "16:9", seed: nil, **opts)+ call(prompt: prompt, image_size: SIZES.fetch(aspect_ratio), **opts)+ end+ end+ end+enddiff --git a/skills/make-an-anime/scripts/lib/fal/models/gpt_image26_edit.rb b/skills/make-an-anime/scripts/lib/fal/models/gpt_image26_edit.rbnew file mode 100644index 0000000..d06d738--- /dev/null+++ b/skills/make-an-anime/scripts/lib/fal/models/gpt_image26_edit.rb@@ -0,0 +1,16 @@+require_relative "base"+require_relative "gpt_image26"++module Fal+ module Models+ # https://fal.ai/models/openai/gpt-image-2.6/sunburst/edit+ class GptImage26Edit < Base+ ENDPOINT = "openai/gpt-image-2.6/sunburst/edit".freeze+ DEFAULTS = GptImage26::DEFAULTS++ def edit(prompt:, image_urls:, aspect_ratio: "16:9", **opts)+ call(prompt: prompt, image_urls: image_urls, image_size: GptImage26::SIZES.fetch(aspect_ratio), **opts)+ end+ end+ end+enddiff --git a/skills/make-an-anime/scripts/lib/pipeline/steps/keyframes.rb b/skills/make-an-anime/scripts/lib/pipeline/steps/keyframes.rbindex 94227bb..09107f3 100644--- a/skills/make-an-anime/scripts/lib/pipeline/steps/keyframes.rb+++ b/skills/make-an-anime/scripts/lib/pipeline/steps/keyframes.rb@@ -1,20 +1,21 @@module Pipelinemodule Steps# Step 2b — new framings of the reference character (extreme close-up, reframed, other gaze...) for the Shots step:- # prompts/<run>/02_keyframes.yml { name => edit prompt }, each sent with the ref_base image to gpt-image-2.5/edit.+ # prompts/<run>/02_keyframes.yml { name => edit prompt }, each sent with the ref_base image to gpt-image-2.6/edit.# A spec can also be { "prompt" => ..., "refs" => [run, ...] } to add other runs' ref_base images (a second character):# image_urls = [this run's ref_base, *those], so the prompt can say "the character in the second image".+ # Generation option edit_model: Fal::Models::GptImage25Edit paints the keyframes with another image model.# "base" => <keyframe name> edits an earlier keyframe of this list instead of ref_base (same framing, new pose),# "base" => false sends only the refs (a keyframe without the singer), "base" => "<run>/<keyframe>" edits another run's keyframe.class Keyframes < ItemsStep- MODEL = Fal::Models::GptImage25Edit+ MODEL = Fal::Models::GptImage26Editdef specs = yaml("02_keyframes")def generate(name, spec)spec = { "prompt" => spec } if spec.is_a?(String)refs = Array(spec["refs"]).map { |run| Project.new(run).fetch!(:ref_base, :url) }- result = MODEL.new(client: client).edit(prompt: project.expand(spec.fetch("prompt")), image_urls: [*base_url(spec.fetch("base", "ref_base")), *refs])+ result = model.new(client: client).edit(prompt: project.expand(spec.fetch("prompt")), image_urls: [*base_url(spec.fetch("base", "ref_base")), *refs])url = result.output.fetch("images").first["url"]{ request_id: result.request_id, input: result.input, url: url, path: download(url, "02_kf_#{name}.png") }end@@ -37,10 +38,12 @@ module Pipelineprotected- def endpoint = MODEL.endpoint+ def endpoint = model.endpointprivate+ def model = project.generation.fetch(:edit_model, MODEL)+def base_url(base)return if base == falsereturn project.fetch!(:ref_base, :url) if base == "ref_base"diff --git a/skills/make-an-anime/scripts/lib/pipeline/steps/ref_base.rb b/skills/make-an-anime/scripts/lib/pipeline/steps/ref_base.rbindex 7c087e0..71f40ff 100644--- a/skills/make-an-anime/scripts/lib/pipeline/steps/ref_base.rb+++ b/skills/make-an-anime/scripts/lib/pipeline/steps/ref_base.rb@@ -1,9 +1,9 @@module Pipelinemodule Steps# Step 1 — the singer reference frame (text-to-image, prompt = prompts/<run>/01_ref_base.*).- # nano-banana-2 unless the generation sets image_model: (e.g. run3 uses gpt-image-2.5).+ # GPT Image 2.6 unless the generation sets image_model: (or edit_model: for photos and edit_from), e.g. Fal::Models::GptImage25.class RefBase < Step- MODEL = Fal::Models::GptImage25+ MODEL = Fal::Models::GptImage26# A character sheet from reference photos: `photos: ["references/hero/front.png", ...]` (project-relative) are uploaded# and sent with the prompt to the Sunburst edit endpoint, which redraws the person in the approved anime style.@@ -42,7 +42,7 @@ module Pipelineprotected- def model = project.generation[:edit_from] || project.generation[:photos] ? Fal::Models::GptImage25Edit : project.generation.fetch(:image_model, MODEL)+ def model = project.generation[:edit_from] || project.generation[:photos] ? project.generation.fetch(:edit_model, Fal::Models::GptImage26Edit) : project.generation.fetch(:image_model, MODEL)def endpoint = model.endpointendenddiff --git a/skills/make-an-anime/scripts/spec/anime_spec.rb b/skills/make-an-anime/scripts/spec/anime_spec.rbindex d6f379b..3d3ce84 100644--- a/skills/make-an-anime/scripts/spec/anime_spec.rb+++ b/skills/make-an-anime/scripts/spec/anime_spec.rb@@ -85,7 +85,7 @@ RSpec.describe "Anime scene pipeline", :media doexpect([@fresh, @stale, @rebuilt]).to eq([true, true, true])expect(@music_stale).to be(true)expect(@refit).to eq([true, "local:#{music}", false])- kf = client.calls.find { |e, _| e == Fal::Models::GptImage25Edit.endpoint }+ kf = client.calls.find { |e, _| e == Fal::Models::GptImage26Edit.endpoint }expect(kf[1][:prompt]).to eq("Clean cel-shaded TV anime. Kid in bed")h3 = client.calls.select { |e, _| e.include?("image-to-video") }expect(h3.size).to eq(1) # still and colour shots make no model call, also when rebuilt after a spec changediff --git a/skills/make-an-anime/scripts/spec/live_spec.rb b/skills/make-an-anime/scripts/spec/live_spec.rbindex 607835a..a1bc20c 100644--- a/skills/make-an-anime/scripts/spec/live_spec.rb+++ b/skills/make-an-anime/scripts/spec/live_spec.rb@@ -11,11 +11,11 @@ RSpec.describe "Paid Fal and local finishing", :live doFileUtils.mkdir_p("docs"); FileUtils.mkdir_p("config")File.write("docs/PLAN.md", "Paid test: one image, one edit, one H3 5s, one Whisper, one Demucs and one SFX. No rerolls.")Workflow::Approval.new.record!("LIVE_FAL=1 supplied by test operator")- image_model = Fal::Models::GptImage25.new(client: client)+ image_model = Fal::Models::GptImage26.new(client: client)generated = image_model.generate(prompt: "Hyper quality polished playful 2D music video character: red cartoon robot singer, expressive face with clear mouth, full body centered, flat green #00B140 background. No text, no extra characters, no green clothing.")image = client.download(generated.output.fetch("images").first.fetch("url"), file("identity.png"))expect(magick.identify(image)[:w]).to be >= 1920- edited = Fal::Models::GptImage25Edit.new(client: client).edit(prompt: "The SAME robot character and style, same flat chroma green. Keep the face clearly visible, raise one hand in an expressive singing pose. Hyper quality polished detail, no text.", image_urls: [generated.output["images"][0]["url"]])+ edited = Fal::Models::GptImage26Edit.new(client: client).edit(prompt: "The SAME robot character and style, same flat chroma green. Keep the face clearly visible, raise one hand in an expressive singing pose. Hyper quality polished detail, no text.", image_urls: [generated.output["images"][0]["url"]])client.download(edited.output["images"][0]["url"], file("pose.png"))input = ff.extract_audio(song, file("song.wav"), seconds: 5)input = ff.fit_audio(input, file("padded.wav"), seconds: 5, fade: 0) if ff.duration(input) < 5diff --git a/skills/make-an-anime/scripts/spec/pipeline_spec.rb b/skills/make-an-anime/scripts/spec/pipeline_spec.rbindex 2a1c0f7..2158d2f 100644--- a/skills/make-an-anime/scripts/spec/pipeline_spec.rb+++ b/skills/make-an-anime/scripts/spec/pipeline_spec.rb@@ -35,7 +35,7 @@ RSpec.describe "Character to animated scene pipeline", :media doapprovePipeline::Steps::RefBase.new(project:revised,client:client).run!end- expect(client.calls.first[0]).to eq(Fal::Models::GptImage25Edit.endpoint)+ expect(client.calls.first[0]).to eq(Fal::Models::GptImage26Edit.endpoint)expect(client.calls.first[1][:image_urls]).to eq(["fixture://approved-v1"])expect(Digest::SHA256.file(image).hexdigest).to eq(before)expect(revised[:ref_base]["path"]).not_to eq(image)@@ -67,8 +67,8 @@ RSpec.describe "Character to animated scene pipeline", :media doPipeline::Steps::Keyframes.new(project: project, client: client).run!Pipeline::Steps::Clips.new(project: project, client: client).run!end- expect(client.calls[0][1][:quality]).to eq("xhigh")- expect(client.calls[1][0]).to eq(Fal::Models::GptImage25Edit.endpoint)+ expect(client.calls[0][1]).to include(quality: "high", reasoning_effort: "high")+ expect(client.calls[1][0]).to eq(Fal::Models::GptImage26Edit.endpoint)h3 = client.calls.lastexpect(h3[1]).to include(resolution: "768P", duration: 5)expect(h3[1][:target_audio_url]).to start_with("fixture://04_audio_")