Photoreal Blender scenes from a one-paragraph brief, built by AI agents: image→3D props on fal, scripted layout, lighting, camera and grade.
Python
Builder: text, image, video, kit and scene-to-scene routes
Apekshik Panigrahi88c1daf0b47b
diff --git a/builder/app.py b/builder/app.pyindex c513842..8826760 100644--- a/builder/app.py+++ b/builder/app.py@@ -27,6 +27,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(_HERE), "endpoint"))import planner # noqa: E402 (the critic's Claude client; bundled by value)import scene_builder # noqa: E402import gallery # noqa: E402 (the shared builds gallery: /builds, /build_events)+import sources # noqa: E402 (what each scene route starts from: images, text, video, a kit, an earlier build)import schema # noqa: E402,F401if os.name == "nt":@@ -142,9 +143,8 @@ class BuildShots(BaseModel):dials: dict[str, float | str] = Field(default_factory=dict, description="Changes for these shots only.")-class BuildRequest(BaseModel):- reference_image_urls: list[str] = Field(description="1-4 reference images: the look to build.")- prompt: str = Field("", description="Anything the images can't show.")+class SceneOptions(BaseModel):+ """What every scene route shares; each route adds its own source (images, text, video, a kit, a scene)."""floor_plan_url: str | None = Field(None, description="Optional floor plan: a sketch, photo or drawing of the layout.")fresh: bool = Field(False, description="Build again from scratch even if an identical request already has a build.")effort: str = Field("medium", description="Claude effort for the builder: low, medium, high, xhigh, max.")@@ -161,8 +161,49 @@ class BuildRequest(BaseModel):"an identical request from someone else attaches to the same build."))+class BuildRequest(SceneOptions):+ """/ref2scene: any mix of sources. With no image, video, kit or scene, the prompt alone is the brief."""+ reference_image_urls: list[str] = Field(default_factory=list, description="0-4 reference images: the look to build.")+ prompt: str = Field("", description="Anything the references can't show; with no other source, the whole brief.")+ video_url: str | None = Field(None, description="A video of the place (footage or a generated clip): its frames "+ "become references.")+ kit_id: str | None = Field(None, description="An AnyKit kit (k_...) on this fal account: the set is dressed with its "+ "props.")+ source_build_id: str | None = Field(None, description="A finished build (b_...) to change instead of starting "+ "over: the prompt and dials say what to change.")+++class ImageToSceneRequest(SceneOptions):+ reference_image_urls: list[str] = Field(description="1-4 reference images: the look to build.")+ prompt: str = Field("", description="Anything the images can't show.")+++class TextToSceneRequest(SceneOptions):+ prompt: str = Field(description="The place, in words. A reference image is generated from it first.")+++class VideoToSceneRequest(SceneOptions):+ video_url: str = Field(description="A video of the place: real footage or a generated clip.")+ prompt: str = Field("", description="Anything the video can't show.")+++class KitToSceneRequest(SceneOptions):+ kit_id: str = Field(description="An AnyKit kit (k_...) on this fal account: the set is dressed with its props.")+ reference_image_urls: list[str] = Field(default_factory=list, description=(+ "0-4 reference images for the place. Without any, the kit's own style references are used."))+ prompt: str = Field("", description="The place the kit goes in, e.g. 'a cramped 1970s control room'.")+++class SceneToSceneRequest(SceneOptions):+ source_build_id: str = Field(description="A finished build (b_...) to change.")+ prompt: str = Field(description="What to change, in words, e.g. 'it's 1 AM and raining; make the room twice as "+ "deep'. Everything not mentioned stays as built.")++class BuildResponse(BaseModel):build_id: str+ reference_urls: list[str] = Field(default_factory=list, description=(+ "The references the build worked from, including any generated from text or taken from the video."))stills: list[str]scene_blend_url: str | Nonescene_glb_url: str | None@@ -230,7 +271,7 @@ class SceneBuilderApp(fal.App):machine_type = ["GPU-RTX5090", "GPU-RTXPRO6000"]image = ContainerImage.from_dockerfile_str(DOCKERFILE)requirements = ["pydantic", "anthropic", "pillow", "fal==1.84.0", "fal-client", "claude-agent-sdk==0.2.176"]- local_python_modules = ["scene_builder", "planner", "schema", "gallery"]+ local_python_modules = ["scene_builder", "planner", "schema", "gallery", "sources"]min_concurrency = 0max_concurrency = 10request_timeout = 7200 # fal's cap; longer builds resume in a second request@@ -266,6 +307,32 @@ class SceneBuilderApp(fal.App):async def build(self, req: BuildRequest) -> BuildResponse:return await self._build_and_shoot(req)+ # Single-source routes: each is /ref2scene with one kind of input, so they share its build, retry index and gallery.+ @fal.endpoint("/image2scene")+ async def image2scene(self, req: ImageToSceneRequest) -> BuildResponse:+ """Reference images -> a production-ready 3D set."""+ return await self._build_and_shoot(BuildRequest(**req.model_dump()))++ @fal.endpoint("/text2scene")+ async def text2scene(self, req: TextToSceneRequest) -> BuildResponse:+ """A description -> a generated reference -> a production-ready 3D set."""+ return await self._build_and_shoot(BuildRequest(**req.model_dump()))++ @fal.endpoint("/video2scene")+ async def video2scene(self, req: VideoToSceneRequest) -> BuildResponse:+ """A video of a place -> the set it shows, built from frames across the whole clip."""+ return await self._build_and_shoot(BuildRequest(**req.model_dump()))++ @fal.endpoint("/kit2scene")+ async def kit2scene(self, req: KitToSceneRequest) -> BuildResponse:+ """An AnyKit kit (+ a place) -> a set dressed with the kit's props."""+ return await self._build_and_shoot(BuildRequest(**req.model_dump()))++ @fal.endpoint("/scene2scene")+ async def scene2scene(self, req: SceneToSceneRequest) -> BuildResponse:+ """A finished build + changes in words or dials -> the same set, changed; the rest stays as built."""+ return await self._build_and_shoot(BuildRequest(**req.model_dump()))+async def _build_and_shoot(self, req: BuildRequest) -> BuildResponse:import timet0 = time.time()@@ -336,9 +403,17 @@ class SceneBuilderApp(fal.App):# Retry-safe: fal's queue re-runs a request that times out or loses its worker. Each identical request maps# to one build; a repeat returns the finished result, waits for a live attempt, or resumes a dead one in the# same workspace, where nothing already generated is paid for again (generate/fal.mjs skips and resumes).- fp = hashlib.sha256(json.dumps({"refs": req.reference_image_urls, "prompt": req.prompt, "dials": req.dials,- "floor_plan": req.floor_plan_url, "scene": req.scene, "effort": req.effort},- sort_keys=True).encode()).hexdigest()[:20]+ try:+ sources.check(req)+ except ValueError as e: # a bad source is the caller's mistake: 422, not a 500+ from fastapi import HTTPException+ raise HTTPException(status_code=422, detail=str(e)) from None+ key = {"refs": req.reference_image_urls, "prompt": req.prompt, "dials": req.dials,+ "floor_plan": req.floor_plan_url, "scene": req.scene, "effort": req.effort}+ # only when set, so builds from before these sources existed keep their fingerprints+ key.update({k: v for k, v in (("video", req.video_url), ("kit", req.kit_id),+ ("source", req.source_build_id)) if v})+ fp = hashlib.sha256(json.dumps(key, sort_keys=True).encode()).hexdigest()[:20]index = os.path.join(BUILDS_DIR, "_index", fp + ".json")os.makedirs(os.path.dirname(index), exist_ok=True)resume = False@@ -385,26 +460,22 @@ class SceneBuilderApp(fal.App):os.makedirs(os.path.join(work, "input"), exist_ok=True)upload = lambda p: File.from_path(p).url- refs = []if resume: # the workspace is there: refresh the shared tools, keep the scene's own scripts and assetsfor rel, text in TOOLKIT.items():path = os.path.join(work, rel)os.makedirs(os.path.dirname(path), exist_ok=True)with open(path, "w", encoding="utf-8", newline="\n") as f:f.write(text)- for i, url in enumerate([] if resume else req.reference_image_urls[:4]):- path = os.path.join(work, "input", f"src_{i + 1}")- urllib.request.urlretrieve(url, path)- refs.append(path)- # references as PNG whatever came in+ ask = None+ if not resume: # images, text, video, a kit or an earlier build -> reference PNGs, brief, dials (sources.py)+ import asyncio+ pngs, prompt, dials, ask = await asyncio.to_thread(sources.prepare, req, work)+ scene_builder.make_workspace(work, pngs, prompt, req.scene, TOOLKIT, dials)+ else:+ subdirs = [d for d in os.listdir(os.path.join(work, "scenes")) if os.path.isdir(os.path.join(work, "scenes", d))]+ if len(subdirs) == 1: # scene2scene may have taken the earlier build's scene folder+ req.scene = subdirs[0]from PIL import Image- pngs = []- for i, p in enumerate(refs):- out = os.path.join(work, f"ref_{i + 1}.png")- Image.open(p).convert("RGB").save(out)- pngs.append(out)- if not resume:- scene_builder.make_workspace(work, pngs, req.prompt, req.scene, TOOLKIT, req.dials)if req.floor_plan_url and not resume: # the agent reads it as input/floor_plan.pngfp = os.path.join(work, "input", "floor_plan_src")urllib.request.urlretrieve(req.floor_plan_url, fp)@@ -419,9 +490,12 @@ class SceneBuilderApp(fal.App):"generated is on disk, and generate/fal.mjs skips finished outputs and picks up jobs that were in ""flight, so re-running your batch scripts costs nothing for done items. Don't start over: continue ""from the current state to the deliverables.")+ elif ask:+ b.ASK = askb.emit("received", "running", f"{'resuming' if resume else 'build'} {build_id}: {len(refs)} reference image(s)",reference_urls=req.reference_image_urls, prompt=req.prompt, dials=req.dials, effort=req.effort,- floor_plan_url=req.floor_plan_url, owner=req.owner)+ floor_plan_url=req.floor_plan_url, owner=req.owner, video_url=req.video_url, kit_id=req.kit_id,+ source_build_id=req.source_build_id)result = Nonetry:result = await b.run(scene_builder.agent_env())@@ -452,7 +526,7 @@ class SceneBuilderApp(fal.App):if n.endswith((".py", ".json", ".md", ".sh")):z.write(os.path.join(root, n), os.path.relpath(os.path.join(root, n), work))res = BuildResponse(- build_id=build_id, stills=stills, scene_blend_url=url_if(os.path.join(out, "scene.blend")),+ build_id=build_id, reference_urls=[upload(p) for p in refs], stills=stills, scene_blend_url=url_if(os.path.join(out, "scene.blend")),scene_glb_url=url_if(os.path.join(out, "scene.glb")), panorama_urls=panos, previews=previews, package_url=upload(pkg),critiques=[{k: c[k] for k in ("round", "scores", "passed", "summary", "fixes")} for c in b.critiques],dials=json.load(open(os.path.join(out, "dials.json"))) if os.path.exists(os.path.join(out, "dials.json")) else {},diff --git a/builder/sources.py b/builder/sources.pynew file mode 100644index 0000000..8235a55--- /dev/null+++ b/builder/sources.py@@ -0,0 +1,179 @@+"""What each scene route starts from, turned into what the scene builder works with: reference PNGs, the brief, the+dials and, for kit2scene / scene2scene, the kit or the earlier build copied into the workspace.++ /image2scene the images are the references+ /text2scene a reference is generated from the words first (GPT Image 2.5 Sunburst)+ /video2scene stills spread across the clip are the references; smaller frames of the whole clip go in input/video/+ /kit2scene the kit goes in input/kit/; its style references stand in when no images are given+ /scene2scene the earlier build's workspace is copied in and the agent changes it instead of starting over+ /ref2scene any mix of the above+"""++import glob+import json+import os+import re+import shutil+import subprocess+import urllib.request++BUILDS_DIR = "/data/anyscene/builder"+KITS_DIR = "/data/anyscene/kit" # AnyKit's kits: a separate app, same fal account, same /data+REF_MODEL = "openai/gpt-image-2.5/sunburst/text-to-image"+REF_PROMPT = ("A wide photographic film still of the place below, showing the whole space and what fills it. Real "+ "materials with believable wear, motivated practical light, no people, no captions or watermarks, no "+ "real brands.\n\n{}")+VIDEO_REFS = 4 # full-resolution stills from a video that serve as its references+VIDEO_FRAMES = 24 # smaller frames across the whole clip, for the agent to read the space from++TEXT_NOTE = """## Reference (generated)+The customer gave only words. input/reference_1.png was generated from them as a starting point. Where the words and+the image disagree, the words decide what the place is."""++VIDEO_NOTE = """## Video+The references are stills from the customer's video, and input/video/ holds frames from across the whole clip (each+named with its time). Read them all before planning: what the camera passes, how the spaces connect, what is behind+it. Build the place the video shows."""++KIT_NOTE = """## Kit+Dress the set with the AnyKit kit in input/kit/. kit.json lists every prop with its real size in metres; each one's+GLB is in items/<id>/<id>.glb (with a lighter <id>_lod1.glb), and renders/lineup.png shows them side by side. They+are already at real scale and in one style: use them as they are wherever they fit, and generate new props only for+what the kit doesn't have, matching its style."""++EDIT_ASK = """This workspace already holds a finished scene, build {build}: its scripts in scenes/{scene}/scripts/, its+generated assets, scenes/{scene}/NOTES.md, and its deliverables in input/source/ (scene.blend, stills/, plan.json,+shots.json, dials.json). The customer wants it changed. The change is at the end of input/brief.md, under "Changes+requested", and input/dials.json holds the dials to build to. Read SKILL.md, then the NOTES.md and the scripts.+Change the existing scene rather than starting over: edit its scripts, keep everything the change doesn't touch as it+was (layout, props, materials, cameras), and generate new assets only for what the change needs. Then deliver+everything the endpoint asks for into out/ again, from the changed scene."""+++def check(req):+ """Reject a request that can't start, before it gets a build id."""+ if not (req.reference_image_urls or req.prompt.strip() or req.video_url or req.kit_id or req.source_build_id):+ raise ValueError("Give at least one source: reference_image_urls, prompt, video_url, kit_id or source_build_id.")+ if len(req.reference_image_urls) > 4:+ raise ValueError("At most 4 reference images.")+ for name, value, prefix in (("kit_id", req.kit_id, "k_"), ("source_build_id", req.source_build_id, "b_")):+ if value and not re.fullmatch(prefix + r"[0-9a-f]{6,32}", value):+ raise ValueError(f"{name} should look like {prefix}..., not {value!r}")+ if req.kit_id and not os.path.exists(os.path.join(KITS_DIR, req.kit_id, "out", "kit.json")):+ raise ValueError(f"kit {req.kit_id}: no finished kit with that id on this account")+ if req.source_build_id and not os.path.exists(os.path.join(BUILDS_DIR, req.source_build_id, "out", "scene.blend")):+ raise ValueError(f"build {req.source_build_id}: no finished scene.blend to change")+++def prepare(req, work):+ """Fetch and convert the request's sources into `work`. Returns (reference PNGs, brief, dials, ask or None).+ May set req.scene (scene2scene keeps the earlier build's scene folder)."""+ stage = os.path.join(work, ".sources")+ os.makedirs(stage, exist_ok=True)+ os.makedirs(os.path.join(work, "input"), exist_ok=True)+ refs, prompt, dials, ask, notes = [], req.prompt, dict(req.dials), None, []+ if req.source_build_id:+ refs, prompt, dials, ask = from_build(req, work)+ for i, url in enumerate(req.reference_image_urls[:4]):+ refs.append(as_png(download(url, f"{stage}/image_{i + 1}"), f"{stage}/image_{i + 1}.png"))+ if req.video_url:+ refs += video_refs(req.video_url, work, stage, max(1, VIDEO_REFS - len(refs)))+ notes.append(VIDEO_NOTE)+ if req.kit_id:+ kit_refs = copy_kit(req.kit_id, work)+ refs = refs or kit_refs+ notes.append(KIT_NOTE)+ if not refs:+ refs = [text_ref(prompt, stage)]+ notes.append(TEXT_NOTE)+ if notes:+ prompt = (prompt.strip() or "(no prompt: match the reference)") + "\n\n" + "\n\n".join(notes) + "\n"+ return refs[:4], prompt, dials, ask+++def download(url, path):+ urllib.request.urlretrieve(url, path)+ return path+++def as_png(src, dst):+ from PIL import Image+ Image.open(src).convert("RGB").save(dst)+ return dst+++def text_ref(prompt, stage):+ import fal_client+ r = fal_client.subscribe(REF_MODEL, arguments={"prompt": REF_PROMPT.format(prompt.strip()), "num_images": 1,+ "image_size": "landscape_16_9", "quality": "high",+ "output_format": "png"})+ return as_png(download(r["images"][0]["url"], f"{stage}/text_ref"), f"{stage}/text_ref_1.png")+++def video_refs(url, work, stage, n):+ src = download(url, f"{stage}/video")+ probe = subprocess.run(["ffprobe", "-v", "error", "-show_entries", "format=duration", "-of", "csv=p=0", src],+ capture_output=True, text=True)+ try:+ dur = float(probe.stdout.strip())+ except ValueError:+ raise ValueError(f"couldn't read the video ({probe.stderr.strip()[:200] or 'no duration'})") from None++ def grab(t, out, width=None):+ scale = ["-vf", f"scale={width}:-2"] if width else []+ subprocess.run(["ffmpeg", "-v", "error", "-y", "-ss", f"{t:.3f}", "-i", src, "-frames:v", "1", *scale, out],+ check=True)++ frames = os.path.join(work, "input", "video")+ os.makedirs(frames, exist_ok=True)+ for i in range(VIDEO_FRAMES):+ t = dur * (i + 0.5) / VIDEO_FRAMES+ grab(t, os.path.join(frames, f"frame_{i + 1:02d}_{t:06.2f}s.jpg"), 1280)+ # the references: spread from 5% to 95% of the clip (cuts and fades sit at the ends), full resolution+ times = [dur / 2] if n == 1 else [dur * (0.05 + 0.9 * j / (n - 1)) for j in range(n)]+ refs = []+ for j, t in enumerate(times):+ grab(t, f"{stage}/video_ref_{j + 1}.png")+ refs.append(f"{stage}/video_ref_{j + 1}.png")+ return refs+++def copy_kit(kit_id, work):+ kit = os.path.join(KITS_DIR, kit_id)+ shutil.copytree(os.path.join(kit, "out"), os.path.join(work, "input", "kit"), dirs_exist_ok=True,+ ignore=shutil.ignore_patterns("*.zip", ".alive", "critique", "events.jsonl", "builder.log"))+ return sorted(glob.glob(os.path.join(kit, "input", "reference_*.png")))+++def from_build(req, work):+ """scene2scene: copy the earlier build's workspace in (scripts, assets, notes), its deliverables to input/source/+ so this build must make its own, and carry over its references, floor plan, brief and dials."""+ src = os.path.join(BUILDS_DIR, req.source_build_id)+ scenes = [d for d in os.listdir(os.path.join(src, "scenes")) if os.path.isdir(os.path.join(src, "scenes", d))]+ if len(scenes) == 1:+ req.scene = scenes[0]+ skip = lambda d, names: [n for n in names if n.endswith(".zip") or n == ".alive"+ or (os.path.samefile(d, src) and n in ("input", "out", ".builder", ".sources"))]+ shutil.copytree(src, work, ignore=skip, dirs_exist_ok=True)+ # scripts and notes may spell out the old workspace's path+ for path in glob.glob(os.path.join(work, "**", "*"), recursive=True):+ if path.endswith((".py", ".sh", ".json", ".md", ".mjs")) and os.path.isfile(path):+ text = open(path, encoding="utf-8", errors="surrogateescape").read()+ if src in text:+ with open(path, "w", encoding="utf-8", errors="surrogateescape", newline="") as f:+ f.write(text.replace(src, work))+ prev = os.path.join(work, "input", "source")+ os.makedirs(prev, exist_ok=True)+ for f in ("scene.blend", "plan.json", "shots.json", "dials.json", "floor_plan.png"):+ if os.path.exists(os.path.join(src, "out", f)):+ shutil.copy2(os.path.join(src, "out", f), prev)+ if os.path.isdir(os.path.join(src, "out", "stills")):+ shutil.copytree(os.path.join(src, "out", "stills"), os.path.join(prev, "stills"), dirs_exist_ok=True)+ if os.path.exists(os.path.join(src, "input", "floor_plan.png")):+ shutil.copy2(os.path.join(src, "input", "floor_plan.png"), os.path.join(work, "input", "floor_plan.png"))+ read = lambda f, default: open(os.path.join(src, "input", f), encoding="utf-8").read() \+ if os.path.exists(os.path.join(src, "input", f)) else default+ dials = {**json.loads(read("dials.json", "{}")), **req.dials}+ prompt = read("brief.md", "").rstrip() + "\n\n## Changes requested (scene to scene)\n\n" + req.prompt.strip() + "\n"+ refs = sorted(glob.glob(os.path.join(src, "input", "reference_*.png")))+ return refs, prompt, dials, EDIT_ASK.format(build=req.source_build_id, scene=req.scene)diff --git a/docs/endpoint-map.html b/docs/endpoint-map.htmlnew file mode 100644index 0000000..7db9bff--- /dev/null+++ b/docs/endpoint-map.html@@ -0,0 +1,234 @@+<title>AnyAll Endpoint Map</title>+<meta name="claude:viewport-fit-sides" content="cover">+<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Barlow:wght@400;500;600&family=Courier+Prime:wght@400;700&display=swap">+<style>+/* Layout: a production call sheet. Slate header, four departments (Create, Direct, Interop, Farm), each a manifest of endpoint rows stamped LIVE / BUILT / PROPOSED. */+:root {+ --paper: #f3efe4; --card: #fbf9f3; --ink: #1d1b17; --dim: #6b655a; --rule: #cfc7b5;+ --stamp: #c4302b; --built: #2f5d50; --tint: #ebe5d6;+ --display: "Barlow Condensed", "Arial Narrow", sans-serif;+ --body: "Barlow", "Helvetica Neue", Arial, sans-serif;+ --mono: "Courier Prime", "Courier New", monospace;+}+@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {+ --paper: #191815; --card: #22201c; --ink: #ece6d8; --dim: #a39c8d; --rule: #3d3a33;+ --stamp: #f0625b; --built: #7fc3ac; --tint: #2b2924; color-scheme: dark } }+:root[data-theme="dark"] {+ --paper: #191815; --card: #22201c; --ink: #ece6d8; --dim: #a39c8d; --rule: #3d3a33;+ --stamp: #f0625b; --built: #7fc3ac; --tint: #2b2924; color-scheme: dark }++* { box-sizing: border-box }+body { background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--body); margin: 0 }+.wrap { max-width: 1120px; margin: 0 auto; padding-block: 28px 64px;+ padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));+ display: grid; gap: 36px }++.slate { border: 2px solid var(--ink); display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; background: var(--card) }+.slate > div { padding: 10px 14px; border-right: 1px solid var(--ink); min-width: 0 }+.slate > div:last-child { border-right: 0 }+.slate .k { font: 600 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--dim) }+.slate .v { font: 700 22px/1.15 var(--display); margin-top: 4px; text-transform: uppercase }+.slate .v.mono { font: 700 15px/1.3 var(--mono); text-transform: none }++h1 { font: 700 clamp(40px, 7vw, 76px)/.92 var(--display); text-transform: uppercase; margin: 0; letter-spacing: -.01em; text-wrap: balance }+.lede { max-width: 66ch; font-size: 17px; margin: 14px 0 0 }+.lede b { font-weight: 600 }++.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule) }+.principles div { padding: 14px 16px 16px 0 }+.principles div + div { padding-left: 16px; border-left: 1px solid var(--rule) }+.principles h3 { font: 700 18px/1.1 var(--display); text-transform: uppercase; margin: 0 0 6px; letter-spacing: .02em }+.principles p { margin: 0; color: var(--dim); font-size: 14px }++.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: stretch }+.flow a { text-decoration: none; color: inherit; border: 1.5px solid var(--ink); background: var(--card); padding: 12px 14px; position: relative; display: grid; gap: 4px }+.flow a:hover, .flow a:focus-visible { background: var(--tint); outline: none }+.flow a:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); font: 700 16px var(--mono); background: var(--paper); z-index: 1 }+.flow .dept { font: 700 24px/1 var(--display); text-transform: uppercase }+.flow .fam { font: 500 13px/1.3 var(--body); color: var(--dim) }+.flow .tally { font: 400 12px/1.3 var(--mono) }++.bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between }+.filters { display: flex; gap: 6px; flex-wrap: wrap }+.filters button { font: 600 13px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; padding: 8px 12px; border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); cursor: pointer }+.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper) }+.filters button:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px }+.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--dim); align-items: center }++.dept-sec { display: grid; gap: 18px; scroll-margin-top: 16px }+.dept-head { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: baseline; border-bottom: 2px solid var(--ink); padding-bottom: 6px }+.dept-head h2 { font: 700 40px/1 var(--display); text-transform: uppercase; margin: 0 }+.dept-head p { margin: 0; color: var(--dim); max-width: 70ch }++.family { background: var(--card); border: 1px solid var(--rule) }+.fam-head { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 12px 16px; border-bottom: 1px solid var(--rule) }+.fam-head h3 { font: 700 26px/1 var(--display); margin: 0; text-transform: uppercase; letter-spacing: .01em }+.fam-head .app { font: 400 13px var(--mono); color: var(--dim) }+.fam-head .what { flex-basis: 100%; margin: 2px 0 0; font-size: 14px; color: var(--dim); max-width: 80ch }++.row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 2fr) 104px; gap: 6px 18px; padding: 12px 16px; border-bottom: 1px dashed var(--rule); align-items: start }+.row:last-child { border-bottom: 0 }+.row[hidden] { display: none !important }+.id { font: 700 14.5px/1.35 var(--mono); overflow-wrap: anywhere }+.id .ns { font-weight: 400; color: var(--dim) }+.now { font: 400 12px/1.4 var(--mono); color: var(--dim); margin-top: 3px; overflow-wrap: anywhere }+.io { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 8px; font-size: 14px }+.io .k { font: 600 11px/1.9 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--dim) }+.io .note { grid-column: 1 / -1; color: var(--dim); font-size: 13px; margin-top: 4px }+.io .note b { color: var(--ink); font-weight: 600 }++.stamp { justify-self: end; font: 700 13px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; padding: 6px 8px 5px; border: 2px solid currentColor; transform: rotate(-3deg); white-space: nowrap }+.stamp.live { color: var(--paper); background: var(--stamp); border-color: var(--stamp) }+.stamp.built { color: var(--built) }+.stamp.proposed { color: var(--dim); border-style: dashed; transform: none }+.stamp.exp { color: var(--stamp) }+.legend .stamp { transform: none; font-size: 11px; padding: 4px 6px 3px }++.foot { border-top: 2px solid var(--ink); padding-top: 14px; display: grid; gap: 8px; color: var(--dim); font-size: 14px; max-width: 80ch }+.foot b { color: var(--ink) }+code { font: 400 13px var(--mono); background: var(--tint); padding: 1px 4px }++@media (max-width: 820px) {+ .slate { grid-template-columns: 1fr 1fr }+ .slate > div:nth-child(2) { border-right: 0 }+ .slate > div:nth-child(-n+2) { border-bottom: 1px solid var(--ink) }+ .principles { grid-template-columns: 1fr }+ .principles div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule) }+ .flow { grid-template-columns: 1fr 1fr }+ .flow a:nth-child(2)::after { display: none }+ .row { grid-template-columns: minmax(0, 1fr) auto }+ .row .io { grid-column: 1 / -1; grid-row: 2 }+}+@media (max-width: 440px) { .flow { grid-template-columns: 1fr } .flow a::after { display: none } }+@media (prefers-reduced-motion: reduce) { .stamp { transform: none } }+</style>++<div class="wrap">+ <header style="display:grid;gap:18px">+ <div class="slate">+ <div><div class="k">Production</div><div class="v">AnyAll endpoints</div></div>+ <div><div class="k">Prepared for</div><div class="v">fal × Epic</div></div>+ <div><div class="k">Date</div><div class="v">3 Nov 2026</div></div>+ <div><div class="k">Namespace</div><div class="v mono">fal-ai/<family>/<route></div></div>+ </div>+ <h1>One endpoint per pipeline step</h1>+ <p class="lede">Each endpoint takes something a studio already has and returns files its tools open directly: a <b>.blend</b>, an <b>Unreal project</b>, <b>GLB / USD</b>, frames. The routes below are the proposed public names; the grey line under each one is where it runs today.</p>+ </header>++ <section class="principles" aria-label="Design principles">+ <div><h3>Interoperable</h3><p>Outputs are native project files plus plain JSON manifests (scene.json, dials.json, shots.json), never just a video. Blender and Unreal open them as is.</p></div>+ <div><h3>Controllable</h3><p>Every scene ships as a rig. Ten named dials (density, tidiness, wear, wetness, time of day, weather, atmosphere, power, warmth, look) are settings the builder must obey, and stay editable after the build.</p></div>+ <div><h3>Repeatable</h3><p>Identical requests return the stored result (<code>fresh</code> rebuilds). Conversion and render steps are plain code, so the same input gives the same output. Agent steps stream every event and must pass an independent critic.</p></div>+ </section>++ <nav class="flow" aria-label="Departments">+ <a href="#create"><span class="dept">Create</span><span class="fam">AnyScene · AnyKit · AnyRig · AnyMachine</span><span class="tally" data-tally="create"></span></a>+ <a href="#direct"><span class="dept">Direct</span><span class="fam">AnyShot</span><span class="tally" data-tally="direct"></span></a>+ <a href="#interop"><span class="dept">Interop</span><span class="fam">Blender · Unreal · USD · glTF</span><span class="tally" data-tally="interop"></span></a>+ <a href="#farm"><span class="dept">Farm</span><span class="fam">Blender · Unreal · Houdini</span><span class="tally" data-tally="farm"></span></a>+ </nav>++ <div class="bar">+ <div class="filters" role="group" aria-label="Filter by status">+ <button id="f-all" data-f="all" aria-pressed="true">All</button>+ <button id="f-built" data-f="built" aria-pressed="false">Built</button>+ <button id="f-proposed" data-f="proposed" aria-pressed="false">Proposed</button>+ </div>+ <div class="legend">+ <span class="stamp live">Live</span> deployed, in use+ <span class="stamp built">Built</span> works on fal, private or prototype+ <span class="stamp exp">Exp.</span> experiment+ <span class="stamp proposed">Proposed</span> next+ </div>+ </div>++ <main id="sheet" style="display:grid;gap:44px"></main>++ <footer class="foot">+ <p><b>Current fal apps (public):</b> <code>apek/anyscene</code>, <code>apek/anyscene-dev</code> (the new scene routes), <code>apek/anyshot</code>, <code>apek/anykit</code>, <code>apek/blend2unreal</code>, <code>apek/unreal-build</code>. The render farm <code>apek/blender-farm</code> stays private and is reached through scene2video. AnyShot and AnyKit are open source at github.com/apekshik/anyshot and /anykit; AnyScene at github.com/apekshik/anyscene.</p>+ <p><b>Swappable stages:</b> each endpoint is one step, so a generative model can replace a step when it is good enough. AnyShot renders with Cycles today and is designed to take an H3 Max render mode once drift is solved.</p>+ </footer>+</div>++<script>+const D = [+ { id: "create", name: "Create", blurb: "Make the things a scene is built from: whole sets, prop kits, rigged characters and working machines.", fams: [+ { name: "AnyScene", app: "apek/anyscene · public", what: "An agent builds a production Blender set from references, observes its own renders and fixes them until a critic passes it.", eps: [+ ["anyscene/ref-to-scene", "live", "/ref2scene", "Any mix of references: images, text, video, plus optional floor plan, dials, effort", ".blend set + GLBs, scouting previews, dials.json, shots.json (zip)", "The all-in-one route; the three below are single-input shortcuts into it. Images and text work today; video arrives with video-to-scene. <b>Paris bakery:</b> 1 reference → 48 props in 1 h 49 min. Powers studio.anyscene.org."],+ ["anyscene/image-to-scene", "live", "/ref2scene with images", "1–4 images", "The same scene package", ""],+ ["anyscene/text-to-scene", "built", "apek/anyscene-dev /text2scene", "A prompt", "Generates a reference (GPT Image 2.5), then builds the scene", "<b>Lighthouse lantern room</b> from one sentence: passed its critic in 40 min."],+ ["anyscene/video-to-scene", "built", "apek/anyscene-dev /video2scene", "A video: real footage or an H3 Max generation", "The set the video shows, built from stills across the whole clip", "<b>Riad tea salon</b> from a walkthrough clip: passed in 44 min. Camera track output is next."],+ ["anyscene/scene-to-scene", "built", "apek/anyscene-dev /scene2scene", "An existing build + changes in words or dials", "The same set, changed; everything not mentioned stays as built", "<b>Submarine</b> switched to emergency red lighting with a leaking pipe: passed in 73 min."],+ ["anyscene/kit-to-scene", "built", "apek/anyscene-dev /kit2scene", "An AnyKit kit + a place", "A set dressed with that kit's props, generating only what the kit lacks", "<b>Ramen kit</b> dressed into a six-seat alley counter: passed in 62 min."],+ ]},+ { name: "AnyKit", app: "apek/anykit · open source", what: "A cohesive prop kit in one style at real-world scale, fixing raw Meshy/Tripo output to be lighter and cheaper to use.", eps: [+ ["anykit/ref-to-kit", "built", "/ref2kit", "1–4 style references, prompt, optional exact item list, dials", "Props in one style: real dimensions in metres, clean pivots, LODs, lineup render", ""],+ ["anykit/text-to-kit", "proposed", null, "A description, e.g. 1970s mission-control desk clutter", "The same kit, references generated first", ""],+ ["anykit/scene-to-kit", "proposed", null, "An AnyScene build or any .blend", "Its props extracted as a reusable kit", ""],+ ["anykit/asset-to-asset", "proposed", null, "A raw image-to-3D GLB (Meshy, Tripo)", "Normalised: real scale, decimated, LODs, fixed glass and materials", "Tripo H3.1 heroes arrive at ~2M tris / 68 MB."],+ ]},+ { name: "AnyRig", app: "not started", what: "Characters and creatures that move: rigging, motion and faces, targeting Unreal skeletons.", eps: [+ ["anyrig/mesh-to-rig", "proposed", null, "A character or creature mesh", "Skinned rig on the UE5 Mannequin or MetaHuman skeleton", ""],+ ["anyrig/video-to-motion", "proposed", null, "Footage of a performance", "Retargeted animation (FBX, Unreal anim sequence)", ""],+ ["anyrig/video-to-face", "exp", "UE 5.7 MetaHuman Animator", "A talking-face video (real or H3 Max)", "MetaHuman Animator solve → animated MetaHuman", "Stress clips for fear, anger, transitions, lip quiver."],+ ["anyrig/text-to-motion", "proposed", null, "A described action", "Animation on the same skeletons", ""],+ ]},+ { name: "AnyMachine", app: "experiments", what: "Things with working parts, rigged and driven by simple 0–1 controls: hinges, sliders, wheels, legs, even soft goods.", eps: [+ ["anymachine/ref-to-machine", "exp", "local experiments", "Reference image, a mesh or an AnyKit prop", "Rigged model: rebuilt moving parts on measured joint axes, 0–1 controls, baked glTF actions, a collision check", "<b>Laptop lid hinge</b> works: 0–135°, zero overlaps across the sweep. Robot spider, quadruped and backpacks in progress."],+ ["anymachine/machine-to-unreal", "proposed", null, "An AnyMachine build", "Unreal Blueprint with Chaos vehicle or physics constraints", ""],+ ]},+ ]},+ { id: "direct", name: "Direct", blurb: "An AI cinematographer: directions in words become camera moves, rack focus, dolly reveals and graded footage.", fams: [+ { name: "AnyShot", app: "apek/anyshot · open source", what: "Takes any scene plus a brief or a marked-up floor plan and shoots it on the farm.", eps: [+ ["anyshot/scene-to-image", "built", "/scene2image", "A scene (.blend / zip or AnyScene build) + shots by name or in words", "Finished stills with the lens, camera and settings used", ""],+ ["anyshot/scene-to-video", "built", "/scene2video", "Same, plus seconds, fps, resolution, dials", "Rendered camera moves (MP4 + frames)", "<b>14 s walkthrough</b> in ~3 min on fal RTX 5090s vs ~6 h on a local 5070 Ti."],+ ["anyshot/video-to-shot", "proposed", null, "A scene + a reference clip", "The reference's camera move, matched in the scene", ""],+ ["anyshot/scene-to-sequence", "proposed", null, "A scene + shots", "Unreal Level Sequence with the same cameras, for Movie Render Queue", ""],+ ]},+ ]},+ { id: "interop", name: "Interop", blurb: "Move a scene between tools without rebuilding it by hand. Each conversion carries lights, materials and FX, not just meshes.", fams: [+ { name: "Converters", app: "apek/blend2unreal · apek/unreal-build", what: "Headless on fal: a Blender export worker and an Unreal 5.8 build worker.", eps: [+ ["convert/blender-to-unreal", "built", "blend2unreal /export → unreal-build /build", "A .blend (or zip)", "Playable UE 5.8 project: lights in physical units, volumetric fog, gobos as light functions, post and lens, Niagara FX, collision and a spawn point", "<b>Hong Kong:</b> 627 assets, 732 actors, 42 lights, 0 build errors. Working on 5 scenes."],+ ["convert/unreal-to-blender", "proposed", null, "An Unreal level or project", "A .blend with meshes, materials, lights and cameras", "Round trip, so artists can work in either tool."],+ ["convert/scene-to-usd", "proposed", null, "A .blend or Unreal level", "OpenUSD stage (and USD back in)", "Interchange with Omniverse, Houdini, Maya."],+ ["convert/scene-to-gltf", "built", "endpoint /build scene_glb", "A .blend", "Web-weight scene.glb: decimated, 1K textures, lights", "Used for the 360 view in the browser."],+ ]},+ ]},+ { id: "farm", name: "Farm", blurb: "GPU render and bake capacity on fal, callable as an endpoint or from inside the app.", fams: [+ { name: "Render farms", app: "apek/blender-farm · apek/unreal-build", what: "Scales out to 20 workers on the account; bundles are cached on the workers.", eps: [+ ["farm/blender", "built", "apek/blender-farm", "A scene bundle + Blender args", "Rendered frames (Cycles), split across workers", "<b>1,208 frames</b> (48 spp, 1920×804) in 8 min on 20 workers, $8.66. Ships as a Blender add-on."],+ ["farm/unreal", "built", "unreal-build /render", "An Unreal project + cameras", "Movie Render Queue stills or clips, rendered offscreen", "Matches a local render at 47–50 dB PSNR."],+ ["farm/bake", "built", "blend2unreal /shard", "Assets from a scene", "Baked textures, sharded across workers with a shared cache", "Runs inside blender-to-unreal today."],+ ["farm/houdini", "proposed", null, "A Houdini file", "Simulated and rendered FX (Karma)", ""],+ ]},+ ]},+];++const LABEL = { live: "Live", built: "Built", exp: "Exp.", proposed: "Proposed" };+const esc = (s) => s.replace(/&/g, "&").replace(/</g, "<");+const sheet = document.getElementById("sheet");+sheet.innerHTML = D.map((d) => `+ <section class="dept-sec" id="${d.id}">+ <div class="dept-head"><h2>${d.name}</h2><p>${d.blurb}</p></div>+ ${d.fams.map((f) => `+ <article class="family">+ <div class="fam-head"><h3>${f.name}</h3><span class="app">${f.app}</span><p class="what">${f.what}</p></div>+ ${f.eps.map(([id, st, now, inp, out, note]) => `+ <div class="row" data-st="${st === "proposed" ? "proposed" : "built"}">+ <div><div class="id"><span class="ns">fal-ai/</span>${id}</div>${now ? `<div class="now">today: ${esc(now)}</div>` : ""}</div>+ <div class="io"><span class="k">In</span><span>${esc(inp)}</span><span class="k">Out</span><span>${esc(out)}</span>${note ? `<span class="note">${note}</span>` : ""}</div>+ <span class="stamp ${st}">${LABEL[st]}</span>+ </div>`).join("")}+ </article>`).join("")}+ </section>`).join("");++for (const d of D) {+ const eps = d.fams.flatMap((f) => f.eps);+ const built = eps.filter((e) => e[1] !== "proposed").length;+ document.querySelector(`[data-tally="${d.id}"]`).textContent = `${built} built · ${eps.length - built} proposed`;+}+document.querySelectorAll(".filters button").forEach((b) => b.addEventListener("click", () => {+ document.querySelectorAll(".filters button").forEach((x) => x.setAttribute("aria-pressed", String(x === b)));+ document.querySelectorAll(".row").forEach((r) => { r.hidden = b.dataset.f !== "all" && r.dataset.st !== b.dataset.f; });+}));+</script>