Spaces:
Running on Zero
Running on Zero
Commit History
11 days ago
-
fix: a run never inherits another run's adapter: before anything is attached, every run removes any adapter left on the model (on its components, or kept for a released staged transformer), and a run whose leftover cannot be removed is refused as an adapter failure and never sampled
Unverified signatured9da392 -
fix: everything a user reads after Generate is in the UI's words, and audio too short for the set length is refused in themβ
Unverified signatureThe notes above Diagnostics now state facts that change what the user got, in plain words. A silent mode says the sound the model made was left out and names the mode that keeps it (video to video names none, since it has none). Audio to audio says the sound is the model's, made from the user's, and how much it was changed; audio to video says the sound is the user's, unchanged. Lengths and the trim are said in seconds. A requested level is mentioned only when it was snapped to a different level, never as "you asked for 0.42 ... 0.42 is the nearest". The upscaled size, the decoder and the prompt sent are the run record's and are no longer repeated as notes. The decoder policy, evictions, and a track an encoder offered that the mode does not declare go to the diagnostics. The upscale phase reads "upscaling Γ2", and Upscale off CUDA is refused as "Upscale Γ2 needs a CUDA GPU; this machine runs on cpu." A set length longer than the audio is refused before dispatch with the longest lengtβ¦8a7fa0c -
fix: the local runner preflights adapters and frees memory after a failure, keeps CPU weights' pages, sizes auto-duration as the head does; the worker logs a small GPU slice and the override fetches nothingβ
Unverified signatureReview minors local-runtime-7, -8, -9, -10, space-path-2 and space-path-3. - local-runtime-7: attaching a LoRA on the local runner is preflighted like any load (file x spike, scaled for a converting dtype), from generate before lora.apply, which would report a memory refusal as an unreadable file. A transformer reload that puts captured adapters back promises their bytes too. - local-runtime-8: every load, the clip encode, the denoise and a failed build drop what the failed step held (its frames' locals) and empty the device cache before re-raising; a failed build releases everything it loaded. - local-runtime-9: on the CPU at the checkpoint's own dtype the weights are the file's mapped pages; the move no longer releases them (which evicted the live model the denoise then faulted back in uncounted). A converting load and every unload still release. - local-runtime-10: the auto-duration denoise estimate is the longest clip the duration head can return (constraints.durβ¦f851454 -
feat: the run record carries its diagnostics, and the user-facing notes no longer mix them inβ
Unverified signatureRunRecord gains diagnostics: a tuple of plain lines for the collapsed block - the peak-VRAM laps, the GPU-partition note and the run folder. They are no longer in GenerationResult.warnings, which is for user-facing notes only, so the UI never has to tell the two apart by reading sentences. Evicted-run notes stay in the warnings: PLAN 2.7 makes them something the user is told. Tests: the VRAM-lap specs read record.diagnostics and assert the laps are not in the warnings; the partition note and the run folder are in the diagnostics and not in the warnings.840b952 -
feat: every result carries a structured run record and every failure a category, so the UI renders facts instead of parsing sentencesβ
Unverified signatureGenerationResult.record is a frozen RunRecord of builtins (it crosses the ZeroGPU fork): mode; requested and returned width/height; frames, frame rate and seconds produced; seed; whether stage 2 ran; the decoder that ran; the audio level used; where the length came from (request, model, or the user's audio); the prompt sent after enhancement; adapters as (label, weight, attached modules); worker elapsed seconds on a monotonic clock around the whole run; and peak reserved VRAM where the probe measured it. The notes stay as they were. Every LTXStudioError carries a stable category (quota, timeout, oom, input, adapter, enhancer, bug; constants in errors.py, set per family) and gpu_used, which generate() sets False exactly for a refusal raised before dispatch. errors.categorise(exc) classifies anything reaching the UI: ours by their attributes, torch's CUDA/MPS out-of-memory as oom, the ZeroGPU platform's gr.Errors by their words (quota exceeded / illegal duration as quota, GPU task abortβ¦c08d3e8 -
fix: a run consumes only what its mode declares, and is validated before a GPU is reservedβ
Unverified signatureThe UI keeps the value of every field it hides and /on_generate forwards them all, and nothing downstream scoped them. A stale audio upload was encoded into every mode and muxed into 05/06/07 as "the audio YOU supplied"; a stale image or video became a condition in every condition mode; a hidden prompt drove 04/09/10/11; a hidden enhance flag added 180 s to the reservation and ran Gemma. Nothing checked that a mode's required inputs were present, so image_to_video with no image was an unconditioned, billed run reported as a success. And every check ran after the ZeroGPU dispatch, so each refusal cost a GPU slot. generate() now prepares the request before the dispatch branch, so the reservation estimate and the worker both see the prepared request: scope it to the mode (scope_request_to_mode), require the mode's inputs (require_inputs -> MissingInputError naming the mode, each missing input and a mode that does not need it), validate geometry and length with the new upper bounds, open β¦6e07c8e
-
fix: `audio_to_video` hands back YOUR audio β the model's track is silence when audio is suppliedβ
Unverified signatureA controlled discriminator on the live Space, same pipeline, same 512x960x121 geometry, same seed, one variable β whether an audio input was supplied: audio_to_video (audio IN) video+aac β -88.3 dBFS digital silence text_to_audio_video (no audio) video+aac β -24.2 dBFS real content 64 dB of separation. **Supplying audio suppresses the model's own audio generation.** That is a property of the model, not a defect in our plumbing: `4683a57`'s mux is correct and both files carry a proper 48 kHz stereo AAC track. But `4683a57` chose to mux the model's track, so a user who hands us audio has been getting back a file whose AAC stream is empty β the same emptiness the original mode-11 defect had, now wearing a stream header, which is arguably worse because it looks like a track until you play it. RULED, for `audio_to_video` only: mux the audio the user SUPPLIED. He provided it, he expects it back, and the model's is empty anyway. The six reasons at the mode-11 spβ¦e2f538a -
feat: every generation now reports its peak VRAM β allocated, reserved and total, split by phaseβ
Unverified signatureTwo decisions on this path were taken on VRAM grounds with no VRAM number behind either of them. The enhancer is loaded to CUDA, used, and freed on every call (f967e30), because VRAM safety was required without measuring what it cost. It costs +30.78 s per enhanced generation β 46.53 s against a 15.75 s baseline at 256x256x9 β which is almost exactly a 2.49 GB reload each time. The obvious fix is residency. Nobody knows the headroom on this MIG partition, so the obvious fix is also unpriced. The VAE decode went tiled+framewise at cdb3211 after an NVML allocator assert killed a 1216x704x121 render at the decode. That change was correct and it stays. It is also the second unpriced VRAM decision in a row. So: measure first. `_VramProbe` in generate.py, opened immediately below the dispatch branch, closed just before the result is assembled. WHAT IT REPORTS, and the point of reporting all three: * `max_memory_allocated()` β what the run actually needed. * `max_memory_reserved()` β whβ¦0a4ddbb
-
feat: wire the Hub repo-id direction of LoRA validation β bounded before download, fetched in the web processβ
Unverified signatureThe route existed as an interface and nothing else: validate_lora carried a fetcher seam (PLAN Β§4.6's designed entry point), the UI carried a repo-id textbox, and no fetcher was ever written β so every repo id anyone typed rejected with 'cannot be read', including the UI's own placeholder. This is the wiring. lora/fetch.py (new): resolve 'org/name' or 'org/name/file.safetensors' β exactly the two shapes the textbox promises; URLs are refused naming the accepted forms rather than half-parsed past their revision segments. The size cap binds BEFORE any download, from the Hub's file-metadata listing (HfApi.model_info(files_metadata=True)): an oversized adapter raises the existing LoRATooLargeError β whose message has said 'Refusing before download.' since the day it was written β and the download seam is provably never called. A sizeless listing refuses rather than downloading unbounded ('could not check' must not become 'checked and fine'). Downloads go through hf_hub_download's default β¦b9ee967 -
fix: reconcile uploaded audio with the video length β trim long on upstream's grid, refuse short naming the fixβ
Unverified signatureThe file-encode route had the same Β§5.7 row 11 gap as the supplied- latents branch one seam over: the encoder does no length adjustment, so a 3 s upload against a 5 s video generated to completion and emitted a desynced file with no error anywhere. Policy (ruled): TRIM long, REFUSE short, never pad, never silent. * LONGER than the num_frames-derived video: the waveform is cut and the result's warnings carry 'audio input trimmed from X.XXs to Y.YYs to match N frames' β accommodation, but visible. * SHORTER beyond the 0.05 s tolerance: AudioVideoDesyncError naming both lengths AND the largest legal num_frames the audio covers (nearest_valid_num_frames lower bound of the floored fit β floor, not round, so the suggestion cannot bounce the user back into the same refusal). Raised before the pipeline call, so it costs no quota. * The asymmetry is the policy: trimming discards excess the user can see and undo; padding fabricates input they never gave; silent alteration is worβ¦2eaeb2c -
fix: wire the desync guard β supplied audio_latents are checked against the video lengthβ
Unverified signatureaudio.validate_audio_latents_against_video was exported and documented as 'the check that stops a desynced file being emitted rather than refused' (PLAN Β§5.5, Β§5.7 row 11) β and called by NOTHING: the third advertised-guard-wired-to-nothing in this build (SPACE_MODE_MATRIX Β§8 follow-up #6). The live gap: generate._prepared_audio skips encoding when kwargs already carries audio_latents, so supplied latents set the audio length while num_frames sets the video length and nothing compares them; a mismatched pair generates to completion β on metered GPU β and emits a desynced file with no error anywhere. Wired at that branch, the one seam every supplied-latents run passes through. A desynced pair now raises AudioVideoDesyncError naming both lengths BEFORE the pipeline runs, so the refusal costs no quota. The error crosses the ZeroGPU fork intact thanks to 6bb211a, which is what made wiring it now safe. Video seconds use the same num_frames / frame_rate convention as the UI readout so the rβ¦59cfa6e -
fix: LoRA lifecycle on the warm-worker singleton β detach after every run, activate staged adapters togetherβ
Unverified signatureThe pipeline is a cached singleton (pipelines._CACHE), and _apply_loras only ever attached. Two production consequences on a warm ZeroGPU worker: * the second run with the same staged adapter died inside load_lora_weights on diffusers' duplicate-name ValueError ('Adapter name user_lora_0 already in use', diffusers/loaders/peft.py:227), surfaced through apply_lora's ValueError arm as a misleading LoRAFormatError; * strictly worse and silent: a following run with NO staged adapters generated through the previous user's LoRA β the silent-garbage shape stage 7 exists to prevent, arriving through the lifecycle instead of the load. generate() now records the attach reports and detaches them in a finally, so the singleton returns to base state whether the run succeeded or died. The unload raises on failure β a stuck adapter corrupts every later run on the worker, which outranks any single run's outcome β and a partial attach (adapter 2 of 2 failing stage 7) cleans up tolerantly β¦de78923
-
test: spec the mode registry, the never-empty-output invariant, app build and layeringβ
The generate.py specs are the ones that matter: failure is injected at four depths (model load, decode, missing output file, zero-byte output file) and each must surface a distinct typed error rather than a falsy path. Also asserts there is no newest-file-in-output-dir fallback, statically and behaviourally β the 2.3 version had no run correlation and would show a previous run's video for a run that failed. Mode identifiers are fixed here as the contract: PLAN Β§3.2 numbers and labels the modes but never names them.1e0df90