[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116493":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":12,"stars30d":12,"stars90d":14,"forks30d":14,"starsTrendScore":15,"compositeScore":16,"rankGlobal":9,"rankLanguage":9,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":9,"pushedAt":22,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":14,"starSnapshotCount":14,"syncStatus":13,"lastSyncTime":26,"discoverSource":27},116493,"anyshot","apekshik\u002Fanyshot","apekshik","AnyShot: an AI cinematographer for 3D scenes on fal. Scene in, directed shots out.",null,"Python",71,11,2,0,3,49.72,"MIT License",false,"main",true,[],"2026-11-01 22:24:00","2026-11-23 19:29:22","# AnyShot: an AI cinematographer for 3D scenes\n\nPairs with [AnyScene](https:\u002F\u002Fgithub.com\u002Fapekshik\u002Fanyscene), the scene builder: AnyScene builds the set from reference\nimages, AnyShot shoots it. AnyShot also works on its own, on any Blender scene.\n\nAnyShot turns a 3D scene and plain-language shot directions into finished stills and camera moves. It is not a\nrender farm with a prompt box: a Claude agent works the set the way a DP would. It reads the scene, works out what\nis where, turns \"slow push along the counter, rack focus to the register\" into a real camera move with a lens, an\nease and a focus pull, checks every frame of the move for clearance against walls and furniture, blocks each shot\nwith quick previews and fixes what reads wrong from the new angle, then renders and grades the finals.\n\n- **`\u002Fscene2image`**: finished, graded stills, rendered with Cycles on the agent's own GPU.\n- **`\u002Fscene2video`**: camera moves as mp4s. The agent plans and checks the moves; the frames are rendered on a render\n  farm app (`farm\u002Fapp.py`) across up to 100 GPUs at once, then graded and encoded.\n\nDirect it shot by shot (`shots`), or just brief it in words (`prompt`: \"a 40-second piece: open wide, walk in like a\nvisitor, then three close dolly reveals with rack focus\") and the agent plans the shot list itself.\n\nThe scene comes in one of two ways:\n- `scene_url`: a `.blend`, or a `.zip` holding a `.blend` and its textures, uploaded anywhere (fal storage, S3,\n  a signed link). The agent unpacks it, finds the main `.blend`, repairs texture paths, packs a self-contained copy\n  and works only on that copy. It keeps the scene's own look. `examples\u002Ftea_room.zip` is a tiny one to try.\n- `build_id`: an AnyScene build (see [AnyScene integration](#anyscene-integration)).\n\nOptionally, `floor_plan_url` is an image of the set's plan, with or without a camera path drawn on it. The agent\nregisters the plan to the scene and places cameras from it, following a drawn path as a walkthrough.\n\nEach order is retry-safe: an identical request (same scene, shots, settings) returns the finished result, attaches to\nthe attempt still running, or resumes a dead one where it stopped, without re-rendering frames already on disk.\n\n## How it works\n\n```\nrequest ─▶ AnyShotApp (app.py, fal, 1 GPU)                             farm\u002Fapp.py (fal, up to 100 GPUs)\n           ├ fetch the scene (or open the AnyScene build)\n           ├ Claude agent (agent\u002Fdirector.py, agent\u002FSHOTS.md)\n           │   read the set · plan cameras (camera\u002Fcamrig.py)\n           │   clearance check every frame · block with Eevee previews\n           │   stills: Cycles finals on this GPU, ffmpeg grade\n           │   video:  farm_render ────────────────────────────────▶  frame chunks, one Blender per request\n           │           grade + encode mp4 ◀─────────────────────────  frames zip on fal storage\n           └ stills \u002F videos \u002F result.json ─▶ response\n```\n\nThe agent is Claude Code driven through the Claude Agent SDK. `agent\u002Fharness.py` runs it: its instructions\n(`agent\u002FSHOTS.md`) appended to the system prompt, a `report` tool for stage events, hooks that stream every tool call,\na 20-second heartbeat, a Stop hook that keeps it going until every shot and `result.json` exist, a guard that stops it\nbefore fal's 2-hour request limit so the app can still deliver, and session resume when the SDK session breaks.\n`agent\u002Fdirector.py` adds the order handling and the `farm_render` tool. Each order's workspace gets `camera\u002F` (the\ncamrig shot rig), `pipeline\u002F` (Blender lookup and a one-job-at-a-time GPU queue) and the instructions at\n`.anyshot\u002FSHOTS.md`, all read from this repo at deploy time.\n\n## Repository\n\n```\napp.py              the fal app (AnyShotApp): \u002Fscene2image, \u002Fscene2video, scene fetching, retry index\nclient.py           the command-line client\nagent\u002F\n  harness.py        the agent harness (Claude Agent SDK): stage events, hooks, heartbeat, cap guard, resume\n  director.py       ShotsDirector (the agent), farm_render, scene and floor-plan fetching, shoot()\n  SHOTS.md          the agent's instructions: shot language, floor plans, blocking, finals, grading\n  blender_gpu.py    forces Cycles onto the GPU in every Blender the agent (or the farm) starts\ncamera\u002F             camrig: moves, focus, lens FX, handheld; shoot.py renders previews, framing sheets and finals\npipeline\u002F           env.sh (finds Blender and ffmpeg), gpu_run.sh (one Blender GPU job at a time)\nfarm\u002Fapp.py         the render farm (BlenderFarm)\nexamples\u002F           tea_room.zip: a small room (.blend + a texture) to try it on\n```\n\n## Deploy your own\n\nYou need a fal account with Serverless access and an [OpenRouter](https:\u002F\u002Fopenrouter.ai) or Anthropic API key. Run\nevery command from the repository root.\n\n1. **Secrets.** fal secrets are shared by every app on the account, so set each once:\n\n   ```bash\n   fal secrets set OPENROUTER_API_KEY=...     # Claude through OpenRouter (or ANTHROPIC_API_KEY=... for the Anthropic API)\n   fal secrets set FAL_KEY=...                # a fal key of this account: uploads, and the farm calls\n   fal secrets set FAL_SERVERLESS_KEY=...     # optional: the key the farm is called with (defaults to FAL_KEY)\n   fal secrets set ANYSHOT_FARM_APP=\u003Cyour-fal-username>\u002Fblender-farm\n   ```\n\n   With both OPENROUTER_API_KEY and ANTHROPIC_API_KEY set, OpenRouter is used. Optional: `FARM_WORKERS` (default\n   100) caps how many farm requests run at once; keep it at or under the farm's `max_concurrency` and your\n   account's concurrency limit.\n\n2. **The render farm** (for `\u002Fscene2video`):\n\n   ```bash\n   fal deploy farm\u002Fapp.py::BlenderFarm --app-name blender-farm --auth private\n   ```\n\n   Without `ANYSHOT_FARM_APP` (or if the farm is down), `\u002Fscene2video` still works: the agent renders the frames on\n   its own GPU in chunks, which is slower. A request can name a different farm with `farm_app` (advanced; see the\n   API), e.g. a test deployment, without touching the account-wide secret.\n\n   How the farm is set up, and why:\n   - **RTX 5090 workers** (`machine_type` in `farm\u002Fapp.py`): $2.50\u002Fh against $4.00\u002Fh for an RTX PRO 6000, with about\n     10% fewer cores. Switch to `GPU-RTXPRO6000` for sets that need more than 32 GB of VRAM.\n   - **Chunks of at least 24 frames** (`FARM_MIN_CHUNK`, a secret\u002Fenv on the AnyShot app). Every chunk pays a worker\n     boot, the scene download and Blender setting up the set; at 5 frames a chunk that overhead was about 75% of the\n     bill.\n   - **Each worker downloads the scene to its own disk** from the bundle's CDN URL. Don't point workers at one shared\n     copy on `\u002Fdata`: when 42 workers read the same 1.6 GB set at once, each waited about 30 minutes before its first\n     frame, against 18 seconds to download its own copy.\n   - **Shared OptiX kernel cache** on `\u002Fdata\u002Fanyscene-farm\u002Foptix\u002F\u003Cgpu>\u002F` (a small file, read once at boot). OptiX\n     compiles its kernels on a worker's first Cycles render, about 2 minutes; each worker starts from the shared cache,\n     warms it in `setup()` and saves it back when it grows.\n   - **`keep_alive = 300`** so a burst of orders reuses booted workers.\n\n   Measured on a 1.6 GB set (458 objects, 8.6M triangles, 118 textures) at 1920x804 and 160 samples: 42 chunks of 8\n   frames on 42 RTX 5090s, all done in 3 minutes, about 102 s of Blender per chunk (17 s to the first frame, then\n   about 11 s a frame). A 20-second walkthrough at 1920x804 and 256 samples cost about $9 of farm time.\n\n3. **AnyShot:**\n\n   ```bash\n   fal deploy app.py::AnyShotApp --app-name anyshot --auth private\n   ```\n\n   Requirements are listed on the app class (`fal==1.84.0`, `claude-agent-sdk==0.2.176`, `anthropic`, `pydantic`,\n   `pillow`, `fal-client`); the deploying Python needs the same packages, e.g.\n\n   ```bash\n   uv run --python 3.13 --with fal==1.84.0 --with pydantic --with anthropic --with pillow --with fal-client \\\n       --with claude-agent-sdk==0.2.176 fal deploy app.py::AnyShotApp --app-name anyshot --auth private\n   ```\n\n   The worker image installs Blender 5.0.1, ffmpeg and node. `request_timeout` is 7200 s (fal's cap): the agent\n   stops itself at 110 minutes to deliver what it has, and a retried request resumes the order.\n\nStorage: AnyShot keeps uploaded scenes, its retry index and its OptiX cache under `\u002Fdata\u002Fanyshot\u002F`, and reads AnyScene\nbuilds from `\u002Fdata\u002Fanyscene\u002Fbuilder\u002F`, on the account's persistent `\u002Fdata` volume. Each order's working files (blocking\npreviews, frames, the packed copy) live in `out\u002Fshots\u002F\u003Cjob_id>\u002F` inside the scene's workspace.\n\n## AnyScene integration\n\n[AnyScene](https:\u002F\u002Fgithub.com\u002Fapekshik\u002Fanyscene) builds production-ready Blender sets from reference images. Deployed\non the same fal account, its builds live in `\u002Fdata\u002Fanyscene\u002Fbuilder\u002F\u003Cbuild_id>\u002F`, and AnyShot shoots them in place with\n`build_id` instead of `scene_url`: the agent also gets the builder's notes (`scenes\u002F\u003Cscene>\u002FNOTES.md`) and its scouting\ncameras (`out\u002Fshots.json`), so shots can be asked for by camera name. The build itself is never changed; each order\nworks in `out\u002Fshots\u002F\u003Cjob_id>\u002F` and applies `dials` to its own copy.\n\nAnyScene calls AnyShot only over the fal API: its `\u002Fscene2image`, `\u002Fscene2video` and `\u002Fshots` routes, and the `shots`\nhand-off on `\u002Fref2scene`, forward to the AnyShot app named by its `ANYSHOT_APP` secret\n(`fal secrets set ANYSHOT_APP=\u003Cyour-fal-username>\u002Fanyshot`). AnyScene keeps copies of the code both use\n(`camera\u002F`, `blender_gpu.py`, `farm\u002Fapp.py`, `pipeline\u002Fenv.sh`, `pipeline\u002Fgpu_run.sh`), synced from this repo.\n\n## API\n\nBoth routes take the same body and return the same response.\n\n| field | type | |\n|---|---|---|\n| `scene_url` | string | A `.blend`, or a `.zip` with a `.blend` and its textures. Give this **or** `build_id`. |\n| `build_id` | string | An AnyScene build (`b_...`) on the same account. |\n| `prompt` | string | Direction for the whole order in your own words (\"a 45 s trailer: open wide, walk in like a visitor, then slow dolly reveals with rack focus; moody\"). On its own, the agent plans the shot list; with `shots`, it applies to all of them. Give `prompt`, `shots`, or both. |\n| `shots` | list | Optional. Each `{\"name\": ..., \"description\": ...}`; either or both. A name picks an existing camera (an AnyScene scouting camera, or a camera in the `.blend`) and names the output file. |\n| `floor_plan_url` | string | Optional plan image, optionally with a camera path or camera marks drawn on it. |\n| `settings` | object | Optional: `res` `[w, h]`, `samples`, `fps`, `seconds` (per video shot), `lens_mm`, `handheld` (`none` \u002F `walk` \u002F `subtle`), `look` (`clean` \u002F `cinematic` \u002F `gritty` \u002F `vintage`). Missing ones are chosen per shot. |\n| `dials` | object | Optional changes to the set for this order only (`time_of_day`, `atmosphere`, `power`, `warmth`, `wetness`, ...). The source scene is never changed. |\n| `effort` | string | Claude effort: `low`, `medium` (default), `high`, `xhigh`, `max`. |\n| `fresh` | bool | Shoot again even if an identical order already finished. |\n| `farm_app` | string | Advanced, optional: the render farm app (`\u003Cowner>\u002F\u003Capp>`) for this order's video frames, instead of the `ANYSHOT_FARM_APP` secret. Useful for testing a farm deployment. |\n\nResponse: `job_id`, `scene_id`, `stills` (URLs), `videos` (URLs), `result` (per shot: camera, lens, move, settings\nand a note), `missing` (anything not delivered), `agent_cost_usd`, `minutes`.\n\nThe agent streams its progress as `ANYSCENE_STAGE {json}` lines in the request's logs (`stage`, `message`, and a\n`preview_url` for blocking frames and finals). The prefix is shared with AnyScene so either app can relay the other's\nevents. An order takes minutes for a couple of stills and longer for video (blocking, the farm, grading); use the\nqueue, not a synchronous call.\n\n### curl\n\n```bash\n# 1. upload the scene (any URL works; client.py uploads to fal storage, or use your own bucket)\n# 2. submit\ncurl -s https:\u002F\u002Fqueue.fal.run\u002F\u003Cyour-fal-username>\u002Fanyshot\u002Fscene2video \\\n  -H \"Authorization: Key $FAL_KEY\" -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n        \"scene_url\": \"https:\u002F\u002Fexample.com\u002Fmy_set.zip\",\n        \"shots\": [\n          {\"name\": \"counter_push\", \"description\": \"slow push along the counter at eye level, ending close on the register; rack focus from the jar in the foreground to the register\"},\n          {\"description\": \"walk in through the door and turn to reveal the back room, handheld walk, 24mm\"}\n        ],\n        \"settings\": {\"seconds\": 6, \"fps\": 24, \"res\": [1920, 1080]}\n      }'\n# -> {\"request_id\": \"...\", \"status_url\": \"...\u002Frequests\u002F\u003Cid>\u002Fstatus\", \"response_url\": \"...\u002Frequests\u002F\u003Cid>\"}\n\ncurl -s \"https:\u002F\u002Fqueue.fal.run\u002F\u003Cyour-fal-username>\u002Fanyshot\u002Frequests\u002F\u003Cid>\u002Fstatus?logs=1\" -H \"Authorization: Key $FAL_KEY\"\ncurl -s \"https:\u002F\u002Fqueue.fal.run\u002F\u003Cyour-fal-username>\u002Fanyshot\u002Frequests\u002F\u003Cid>\" -H \"Authorization: Key $FAL_KEY\"\n```\n\n### Python\n\n```python\nimport fal_client  # FAL_KEY in the environment\n\nscene = fal_client.upload_file(\"examples\u002Ftea_room.zip\")\nres = fal_client.subscribe(\n    \"\u003Cyour-fal-username>\u002Fanyshot\u002Fscene2image\",\n    arguments={\n        \"scene_url\": scene,\n        \"shots\": [{\"description\": \"wide establishing shot from the doorway, eye level, 24mm\"},\n                  {\"description\": \"tight 85mm detail of the red tin on the counter, shallow focus\"}],\n        \"settings\": {\"res\": [1920, 1080]},\n    },\n    with_logs=True,\n    on_queue_update=lambda u: [print(l[\"message\"]) for l in getattr(u, \"logs\", None) or []],\n)\nprint(res[\"stills\"])\n```\n\n### Command line\n\n`client.py` uploads local files, prints the agent's live log and downloads the results:\n\n```bash\npip install fal-client                     # or prefix the commands with: uv run --with fal-client\nexport FAL_KEY=... ANYSHOT_APP=\u003Cyour-fal-username>\u002Fanyshot\npython client.py image --scene examples\u002Ftea_room.zip --shot \"wide from the doorway, 24mm\" \\\n    --shot \"hero: tight on the red tin, f\u002F1.8\" --settings '{\"res\": [960, 540], \"samples\": 32}' --effort low\npython client.py video --scene examples\u002Ftea_room.zip --shot \"slow push from the doorway to the counter\" \\\n    --settings '{\"seconds\": 3, \"res\": [640, 360], \"samples\": 16}'\npython client.py video --scene my_set.zip --floor-plan plan_with_path.png \\\n    --shot \"follow the drawn path at walking pace\" --settings '{\"seconds\": 8}'\npython client.py video --build-id b_1234567890 --shot hero_wide --shot \"orbit the bar, 35mm\"\n```\n\n`--shot` takes a camera name, words, or `name: words` for both. `--farm-app \u003Cowner>\u002F\u003Capp>` sets `farm_app`. Results\nland in `--out` (default `anyshot_out\u002F`): `response.json`, `events.jsonl`, and the stills and videos.\n\n## Shot grammar\n\nDescribe shots the way you would to a camera crew. The agent maps the words onto the camrig moves\n(`camera\u002FREADME.md`) and checks each against the set:\n\n| say | the agent does |\n|---|---|\n| push in, dolly in, pull out, track along X | a dolly move on 2+ keys; \"slow\" is about 0.2-0.4 m\u002Fs |\n| truck, crab, slide past X | sideways move |\n| crane up, jib, rise, pedestal down | vertical move, aim held or reframed |\n| pan, tilt, whip pan to X | same position, the aim moves |\n| orbit, arc, circle around X | an orbit on X's centre, with a radius and an angle range |\n| reveal X | starts on a foreground element or behind an occluder and moves until X comes into view and frames it |\n| rack focus \u002F pull focus from A to B | a hold on A, then a focus pull to B, with a shallow f-stop so it reads |\n| walkthrough, follow the path, Steadicam | a smooth path at walking pace and eye height; `handheld: walk` adds an operator's step and sway |\n| dolly zoom, vertigo | the lens is solved per frame to hold the subject's size |\n| locked off, tripod | a static camera; `subtle` handheld for life |\n| wide \u002F normal \u002F tight, 24mm, 85mm | 18-24 mm \u002F 35-50 mm \u002F 85-135 mm, or the exact focal length |\n| low angle, eye level, top down, over the shoulder of X | camera height and aim |\n| \"a 6 second push\" | the shot's length (wins over `settings.seconds`) |\n\nObjects are found by name in the scene, so naming them helps (\"the teapot\", \"the red stool\"); the agent also looks\nat the set to find what you mean. A drawn path on a `floor_plan_url` becomes a walkthrough along it, and camera marks\n(an X, a camera icon, a cone of view) become camera positions.\n\nEvery move is checked so the camera never passes within 0.45 m of a wall, furniture or a prop (dust, haze and glass\nthe move is meant to pass don't count). A path through an obstacle goes around it, and the result says so.\n\n## License\n\nMIT, see [LICENSE](LICENSE).\n","AnyShot 是一个面向 3D 场景的 AI 导演工具，将自然语言镜头指令（如“慢推沿柜台移动，焦点切换至收银台”）自动转化为高质量渲染图像或摄像机动画。其核心基于 Claude 智能体，具备场景理解、物理空间校验（如障碍物避让）、镜头调度规划、Eevee 快速预演与 Cycles 最终渲染、自动调色编码等全流程能力；支持本地 Blender 场景或 AnyScene 构建的 3D 场景输入，并可结合平面图进行摄像机路径注册。适用于影视预演、建筑可视化、游戏过场设计等需快速将创意构想落地为专业级镜头输出的轻量级制作场景。","2026-11-24 04:53:40","CREATED_QUERY"]