Spaces:
Running on Zero
Running on Zero
|
Download README.md from fffiloni/fastframes-voice: direct link, hf CLI and curl.
- Browser
- Download file 13.2 kB
-
https://huggingface.co/spaces/fffiloni/fastframes-voice/resolve/main/README.md
- Command line
-
hf download hf://spaces/fffiloni/fastframes-voice/README.md
-
curl -L -o README.md https://huggingface.co/spaces/fffiloni/fastframes-voice/resolve/main/README.md
13.2 kB
| title: FastFrames Voice | |
| emoji: 🎙️ | |
| colorFrom: gray | |
| colorTo: yellow | |
| sdk: gradio | |
| sdk_version: "6.30.0" | |
| python_version: "3.12" | |
| app_file: app.py | |
| pinned: false | |
| hf_oauth: true | |
| hf_oauth_scopes: | |
| - inference-api | |
| - contribute-repos | |
| startup_duration_timeout: 1h | |
| license: other | |
| license_name: apple-amlr | |
| license_link: https://huggingface.co/apple/FastFrames-S/blob/main/LICENSE | |
| short_description: Direct a continuous video shot by voice or text | |
| models: | |
| - apple/FastFrames-S | |
| - apple/FastFrames-L | |
| - FluidVoice-Labs/fluid-speech-pro-onnx | |
| - thinkingmachines/Inkling-2-Mini | |
| - Qwen/Qwen3-4B-Instruct-2507 | |
| - zhuhz22/Causal-Forcing | |
| - Wan-AI/Wan2.1-T2V-1.3B | |
| # FastFrames Voice | |
| A research prototype for directing a continuous generated shot with spoken or written cues. Version 0.9.2. The monitor fills the studio above a horizontal desk for the microphone, transcript and interpreted direction. Open Videos in the header to watch or download finished recordings. | |
| Choose FastFrames-S (default, 1.3B) or FastFrames-L (14B) before starting a shot. Each session uses the same model for its opening, continuations and variants. When the session ends, the model selector becomes available again. | |
| Select Voice and start the microphone, or select Text, write a direction and press Generate segment (Enter to send, Shift+Enter for a new line). Text mode releases the microphone. Switching inputs preserves the shot. Each accepted direction generates one silent segment at 832 × 480 and 16 fps. Choose 1–8 whole seconds (default 4) before submitting each direction. Each second contains 16 frames. The opening generates one extra latent and trims one leading decoded frame after the model’s three startup frames to deliver an exact whole-second clip. The last segment loops locally while you think or the next cue is being prepared. Toggle Loop on the monitor to freeze it. Reduced-motion preferences disable looping by default. Repeats never enter the exported recording. End session joins completed segments into a downloadable MP4. Speak in a quiet place. A continuous 3-second pause ends a spoken direction. Resuming sooner keeps the whole cue together. Directions can last up to 45 seconds. If that limit is exceeded, the mic pauses and asks for a shorter cue before submitting any audio from it. Muting stops capture immediately. A spoken direction in progress stays in memory in this tab until you resume it, send it or discard it. Time spent muted is excluded. A cue that has already been submitted keeps its place in the queue. Ending the session clears its voice draft. The monitor plays the generated frames on an inline canvas, including on iPhone. The studio publishes JPEG strips of eight frames as the generator produces them. Inline playback starts at the first available strip, before the checkpoint and final MP4 are ready. Submitting a direction releases the microphone during transcription, interpretation and rendering. If you left listening on, it resumes when the segment is published. Choose Keep muted or Text to cancel automatic listening. Dictate next direction lets you record one upcoming cue during processing; it waits for the current segment before dispatch. A manually muted mic stays muted after that one cue. In Text mode you can queue the next written direction while the preview plays. Generation of the next segment starts after the current segment and its continuity window have committed and the first playback has finished. API clients can request the same preview events with stream_preview set to true on live_take. The complete take uses a native MP4 player with inline playback and download. | |
| After a clip is complete, voice and text directions can continue the shot or redo its last segment. Check **Redo last segment** to force a variant for one instruction. A redo uses the duration and the starting state of the original (the same initial seed for the opening). The next-segment duration selector is preserved. With an ambiguous cue, answer “last segment” or “next segment” by voice, text or button; the studio keeps the original direction while waiting. Review both versions, then choose **Keep original** or **Use variant**. Ending during review exports the original. Only chosen clips enter the recording and future continuity. | |
| Fluid Speech Pro transcribes voice on CPU. Typed directions bypass speech recognition. Inkling 2 Mini updates the last completed shot via Hugging Face Inference Providers when a provider credential is available. Only the text of the current direction, previous direction, target and visual prompt are sent to the HF router. Use the Hugging Face sign-in button below the studio title before starting a take to use your inference credits for potentially faster interpretation, or set a server-side HF_INFERENCE_TOKEN secret scoped to Inference Providers. Qwen runs locally when no credential is present or the provider call fails. Unambiguous standalone forward/backward camera cues in French or English use a direct translation of travel and viewing angle, shown as Camera cue. The local rule matches the whole instruction. Mixed directions, negations and nonstandard prior camera setups use the interpreter. The interpreter describes the requested change in framing for FastFrames, whose camera motion is text-conditioned. The interpreted direction identifies the model used. Both video models use one xlarge ZeroGPU allocation per segment. The maximum duration is 60 seconds for S and 120 seconds for L. L uses eager FP8 blocks adapted from linoyts and requires more temporary checkpoint space. Both pipelines share the same umT5 text encoder and tokenizer. Between directions, the session keeps its exact occupied attention cache, decoder history, frame indices and random generator state on the Space's temporary filesystem. The studio transfers completed attention frames on a separate CUDA stream during the rollout. It keeps only frames needed for the final rolling window, shares unchanged frame files between local checkpoints, and joins the writer before publishing. Restore applies the same BF16 key rotations as the live window. The latest clip and its immediate predecessor retain their checkpoints. A pending variant has its own temporary checkpoint until the user chooses a version. Ending a session releases the temporary continuity caches. The gallery saves one final MP4 per recording. The in-studio controls can still continue a shot or redo its last segment until the session ends. | |
| Sign-in and sign-out return to the studio in the same tab. The Hub embed uses a separate signed, partitioned session when ordinary cookies are blocked. Browsers without partitioned cookie support may ask for cookie access. If it blocks access, the studio shows its direct address. Changing accounts during a take asks before leaving unsaved work. | |
| For signed-in visitors, the app uses the OAuth contribute-repos scope to write the final MP4 to their private fastframes-voice-studio bucket. Browser-only recordings use the Space’s attached private bucket and a device key from local storage. The Space keeps a small private index with the recording ID, save date, duration, segment count and, for personal uploads, file integrity information. Gallery posters are decoded from the opening frame on demand. New recordings use the save date as their label. Previously saved sessions can still be watched and downloaded from their original location. A failed upload can be retried using the completed local MP4. | |
| API clients use the same Gradio session throughout. Call `begin` with the take ID and an optional `model` of `S` or `L` (default `S`), then `voice_direction` with the take ID, increasing sequence number and base64 mono 16 kHz PCM WAV. Alternatively use `text_direction` with `text` (1–1200 characters). Both endpoints accept an optional integer `seconds` from 1 to 8, default 4. API calls without an `operation` retain append behavior. The studio sends `operation: "auto"` by default. Send `operation: "redo_last"` with the last accepted clip’s `target_rev` to override automatic routing. A `clarify` event carries a question ID. Send a higher sequence number with `reply_to` and either a spoken/written answer or an explicit `answer` of `append`, `redo_last` or `cancel`. For each accepted cue, call `live_take` with its take ID and revision. Its first video output contains the new MP4 when the phase is `segment` or `variant`. After a variant, call `choose_variant` with the take ID, revision and a `choice` of `original` or `variant`. Wait for completion before the next cue. `end_take` closes the shot, then `export_take` returns the full recording. A failed render can be retried with the same revision or replaced by a new direction. | |
| ### Timeline, private media and temporary storage | |
| The timeline appears below the desk after the first completed segment. Each thumbnail shows a segment, its start time and its duration. Select one to watch it in the monitor. Starting another direction returns to the current shot. Only the last accepted segment can be redone. Earlier segments are playback-only. Accepting a variant replaces its thumbnail in place. The gallery stores the final film. | |
| The segment, export and gallery video outputs contain a media descriptor (`video.url` relative to the Space origin, with a matching `media` URL in the status event). To download with an API client, resolve that URL against the Space and pass the status event's `media_key` in the `X-FastFrames-Key` request header. Keep the same Gradio session. A client may instead choose a random 64-character lower-case hexadecimal `media_key` and include it in every callback. Preview strip URLs use the same credential. Private Spaces additionally require the usual Hub authorization. Media URLs alone grant no access. Browsers use inline native video with range requests where first-party or partitioned cookies are supported, or authenticated fetch and a local object URL otherwise. | |
| An open studio refreshes its temporary take while waiting for a direction. A disconnected take expires after 90 minutes of inactivity, checked once a minute. API clients pausing longer can call `keep_alive` with their take. Rendering and interpretation in progress are protected. Renders reserve disk headroom for the selected model and duration before requesting ZeroGPU. When space is insufficient the last valid segment can still be exported. | |
| ## Running the Space | |
| Use the Hugging Face Gradio SDK and ZeroGPU hardware. Attach a **private read-write HF storage bucket** at /data/fastframes-sessions for durable sessions. For a standalone installation point GALLERY_ROOT to an existing persistent directory. The app publishes the gallery entry after the final video is stored. The saved_sessions API supports list and watch. Supply a 64-character random hexadecimal device key or sign in. Watch requires the archive ID. Send the same device key with export_take for anonymous API archives. The application places the video models on CUDA at startup through the Spaces SDK. Install the system packages in packages.txt, the Python dependencies in requirements.txt and the Spaces runtime for local GPU development. Run python app.py from this directory. The CPU speech path is usable on a CPU host. Allow the browser microphone through HTTPS or localhost. The model revisions are recorded in engine.py and speech.py. | |
| ## Credits and licenses | |
| - [FastFrames-L](https://huggingface.co/apple/FastFrames-L) by Apple, with the 14B Wan backbone. The eager FP8 blocks are adapted from [FastFrames-L Live](https://huggingface.co/spaces/linoyts/fastframes-l-live/tree/e9f042cfc08f3d3e6998e457efdbc6bd5e9308a6) by linoyts. The Apple ML Research Model license also applies to the L weights. | |
| - [FastFrames-S](https://huggingface.co/apple/FastFrames-S) by Apple. Apple Machine Learning Research Model is licensed under the Apple Machine Learning Research Model License Agreement. The weights are for non-commercial research, with terms in MODEL-LICENSE.txt. Vendored inference code carries the accompanying LICENSE and ACKNOWLEDGEMENTS. Model dependencies include [Causal-Forcing++](https://huggingface.co/zhuhz22/Causal-Forcing) and [Wan2.1](https://huggingface.co/Wan-AI/Wan2.1-T2V-1.3B). | |
| - Streaming implementation adapted from [FastFrames-S Live](https://huggingface.co/spaces/linoyts/fastframes-s-live) by linoyts, revision 4675f39b08cd95fcecdb8f77d4e27b2dc8b35120. This prototype changes the prompt conditioning during a rollout and omits the periodic scene restart. | |
| - [Fluid Speech Pro by FluidVoice](https://huggingface.co/FluidVoice-Labs/fluid-speech-pro), CC BY 4.0. Uses the authors’ ONNX int8 export. | |
| - [Inkling 2 Mini](https://huggingface.co/thinkingmachines/Inkling-2-Mini) by Thinking Machines, accessed through Hugging Face Inference Providers. | |
| - [Qwen3-4B-Instruct-2507](https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507) by Qwen, Apache 2.0, [GGUF by Unsloth](https://huggingface.co/unsloth/Qwen3-4B-Instruct-2507-GGUF). | |
| - Barlow by Jeremy Tribby and contributors, SIL Open Font License (assets/OFL.txt). | |
| - UI/UX and Space adaptation by [Sylvain Filoni / fffiloni](https://huggingface.co/fffiloni). | |