Spaces:
Running on Zero
Running on Zero
Commit History
9 days ago
-
fix: an adapter whose weight pairs are named lora_down/lora_up is refused at Validate, naming both namings and that this model's loader reads only lora_A/lora_B, instead of passing every check and failing inside the run with "list index out of range"
Unverified signaturedaa617a -
chore: stale comments say what is true now, and three LoRA tests and the test media no longer depend on the machine they run on
Unverified signature- generate.py: the forward mel transform reads only the audio VAE (true since 7cf1547); the VRAM unit no longer names the deleted host scripts. - The stale comments the docs review listed in config.py, pipelines.py, preflight.py, zerogpu.py, tests/verify_streams.py and tests/test_zerogpu.py: the transformers and bitsandbytes pins, the derived int8 packing peak, the 47.375 GiB partition the untiled decode was proven on, the falsified ~68 GB ceiling and the pre-pack 82.2 GB disk reading, the MPS remark, stage-2 parts built on first use, no RAM preflight in preflight.py, blobs that may not be freed rather than 72 GB that never is, and the retired host. - The LoRA message-length bounds count the adapter by its file name, not the temp root's length; the in-use stamp is compared with the clock read just before the load, not a 60 s wall-clock window. - tests/conftest.py puts the session's test media, and the seam test's clip folder, under pytest's base temp, which pytest p…7cb1c38
10 days ago
-
test: the fake transformer drops two modules the real LTX-2.5 model does not have
Unverified signatureTRANSFORMER_MODULE_DIMS listed adaln_single.linear (256, 4096) and audio_adaln_single.linear (256, 2048). The diffusers transformer has neither: the native names are renamed to time_embed.linear and audio_time_embed.linear, and their real shapes are 4096->36864 and 2048->18432. Every adapter conftest built therefore targeted two modules that real peft would refuse, which a stage 6.5 check against the real shape manifest reports as a dimension mismatch. The remaining seven entries are real module names with real dims. The suite is unchanged on the current code in both environments.af3b36e -
test: `conftest.inputs_for` — real inputs for each mode's required kinds
Unverified signatureA run will soon be refused in the web process, before a GPU is reserved, when it lacks an input its mode requires or when its audio file does not open with av. Helpers that call generate(mode=..., seed=7) with nothing else, or with a path-shaped string for the audio, stop reaching the code they are about. inputs_for(mode_id) returns exactly the fields that satisfy a mode's required inputs, read off the registry: a prompt, a PIL image, a real decodable mp4, a real stereo WAV whose length matches STUB_WAVEFORM. The media files are built once per session in a temp dir. audio_file(seconds) and video_file(frames) are exposed for tests that need other lengths. Pair audio with audio_input_ready where the worker must also load it without torch.f4df0d1 -
test: the audio fake takes the generator production hands it — 34 failures and 20 errors, all in the fixture
Unverified signatureWith requirements.txt installed — the environment README prescribes — the offline suite was 34 failed, 20 errors at 445abcb. Every recorded gate had run in a torch-less venv, where it was green. The cause is one line of conftest. `FakeAudioVae.encode` returned `latent_dist=SimpleNamespace(sample=lambda: latents)`, a sampler that takes nothing. Upstream's `DiagonalGaussianDistribution.sample(self, generator=None)` takes a generator, and `audio._sampled` passes the run's one positionally. Without torch, `_seeded_generator` returns None, the draw is bare, and the lambda agreed. With torch the generator is real, so every audio_to_audio and audio_to_video path raised `TypeError` inside the fake. That includes the clean-interpreter reachability probe, which accounts for the 20 errors. Production was right; the fixture was wrong. * `FakeLatentDist.sample(generator=None)` — upstream's signature, pinned against the installed diffusers by `test_the_fake_distribution_takes_what_the_real_one_t…1c404fd
-
perf: the enhancer stays loaded — the +30.78 s reload was protecting headroom that was never scarce
Unverified signature`f967e30` required the enhancer to be loaded to CUDA, used, and freed inside the same call, every call. The argument was VRAM safety: 2.5 GB of Gemma must not still be held at the denoise peak. That argument was correct about the thing it reasoned about, and it was never measured against the thing it cost. ✅ IT COST +30.78 s PER ENHANCED GENERATION — 46.53 s against a 15.75 s baseline at 256×256×9. A 2.49 GB reload, every single time. ✅ AND THE HEADROOM IT PROTECTED WAS AN ARTEFACT OF RUNNING ON THE WRONG GPU. `LTX25_ZEROGPU_SIZE=auto` never promoted anything: the Space spent its entire life on ZeroGPU's `large` size, 47.375 GiB, instead of the 94.971 GiB `xlarge` it was entitled to. Proven from inside the worker: before 47.375 GiB total headroom 1.19 GiB -> residency impossible after 94.971 GiB total headroom ~53.7 GiB -> residency trivially affordable The largest peak this build has ever measured is stage 2 at 704×480×49: 55.906 GiB reserved. Plus a permanen…52a0f56
-
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 -
test: FakePipeline mirrors delete_adapters — the lifecycle made a real method load-bearing
Unverified signatureThe reachability tracer drives a full generation with a staged adapter through conftest's FakePipeline. After de78923 the unload step refused that fake: it had load_lora_weights but no delete_adapters, so the cannot-detach fail-loudly path fired against an object that no longer mirrors the real pipeline — LoraBaseMixin has carried delete_adapters all along. Added the mirror (drop the adapter from every loadable component's peft_config and module lora_A/lora_B), additively, so the fake expresses the lifecycle rather than the check being weakened. Conftest's own rule: the fake must be able to express the behaviour or the test is theatre.21cee0f
-
fix: one rearrangement, not two -- drop the latent transpose
Unverified signature466bbd5 was an over-correction and host-runner has the A/B. With the mel time-major AND unpacked_latents applied, the latents came back (1, 8, 16, 101) -- transposed back -- and every reconstruction was pinned to 0.61 s regardless of input, with all four tones lost. audio_vae.encode does NOT reorder axes. It downsamples both by the compression ratio and preserves their order, so the MEL's layout decides the latents' layout. Fed a time-major mel it returns [B, C, L, M] directly. The measurement that produced the transpose was taken before encoder_layout existed in the path: with a mel-major mel the latents were mel-major too, and what was observed was the mel's transposition showing up one stage later. The symptom's location is not its origin. AUDIO_LATENT_DIMS stays; it was right throughout, and the only question was whether a transpose was needed to reach it -- an answer that changed when the input orientation changed. The invariant that catches this in EITHER direction, and host-r…f1f0a59 -
fix: match the mel to the module, not just to its dtype
Unverified signatureRuntimeError: Input type (CPUBFloat16Type) and weight type (CUDABFloat16Type) should be the same load_waveform returns a CPU tensor, the mel is computed on the waveform's device, and the VAE's weights are on the accelerator. _matched_dtype matched one of the two things that have to agree. Renamed to _matched_to_module, because the name is why the device half would be removed later: a helper named after one attribute keeps that attribute and loses the others to whoever tidies it to match its own name. It is matching a tensor to a module, not a dtype to a dtype. Both are read off the component. WEIGHT_DTYPE is right until a quantised load lands; "cuda" is right until offload or a second device. There is a test with a cuda:1 VAE that fails if a constant creeps back in, as there already is for int8. This is the FOURTH attribute of one tensor hand-off to have been wrong in turn: from_pipe recasting bf16 to fp32, .numpy() on bf16 going out, float32 into a bf16 conv_in coming in, and no…825bfde -
fix: batch in the product, and put the latents in upstream's layout
Unverified signatureFour structural defects in the audio-input path, all found by host-runner varying inputs through the to_mel= seam. audio.py had been untouched. THE BATCHING WAS IN THE HARNESS, NOT THE PRODUCT. A script commit added it, so H17 would have passed while a user uploading a wav still got a 3D mel and a refusal from our own validator. That is the harness-proves-the-model trap, one layer down from where we last hit it. Batched inside encode_waveform_to_latents, and AFTER match_channel_count -- the two guards contradict each other in any other order. match_channel_count reads the channel count off axis 0, so a batched (1, 2, N) stereo clip looked like mono, was 'widened' by duplication, reached the VAE with batch 2, and told the user their audio was mono. It now refuses a non-2D waveform rather than misreading one, and the ordering constraint is documented at both ends. audio_vae.encode emits [B, C, M, L]; upstream reads [B, C, L, M]. Established by experiment -- halving the input halves ax…466bbd5 -
fix: the mel must reach the encoder batched AND time-major
Unverified signatureThe dtype cast was necessary and not sufficient. audio_vae.encode then refused the tensor, and our validator was right to. Upstream states the contract in its own comment, autoencoder_kl_ltx2_audio.py line 445: # hidden_states expected shape: (batch_size, channels, time, num_mel_bins) torchaudio returns [channels, mel, time]. That is unbatched AND has the last two axes reversed. Both were wrong. THE TRANSPOSE IS THE HALF THAT HIDES. Supplying only the batch axis gives [1, 2, 64, 401], which is 4D, satisfies the rank check, satisfies validate_audio_latents_shape downstream, and is a transposed spectrogram -- the encoder reads it as 64 time steps of 401 mel bins. It would have produced audio, and the audio would have been wrong with nothing reporting it. That was the obvious fix and it was the dangerous one. The validator needed no loosening. MEL_INPUT_DIMS ends (time, mel) and AUDIO_LATENT_DIMS ends (frames, mel) -- the same ordering, and upstream reads the frame count from that …23f7e8b -
fix: cast the mel to the dtype the audio VAE actually uses
Unverified signaturebuild_mel_front_end computes in float32 and returned float32 into a bf16 VAE: RuntimeError: Input type (float) and bias type (c10::BFloat16) should be the same -- autoencoder_kl_ltx2_audio.py:446, forward -> self.conv_in This is the exact mirror of c628a2a. That was bf16 -> numpy on the OUTPUT side, where numpy has no bfloat16. This is float32 -> bf16 on the INPUT side, where the VAE's weights are bf16. Same boundary, opposite direction, same class -- and one end was fixed this morning without looking at the other. The float32 computation is kept deliberately. host-runner confirmed the mel itself is correct -- min = log(1e-05) exactly, real dynamic range -- and an STFT in bf16 would lose precision exactly where the log floor matters. Only the hand-off changes. The dtype is READ OFF audio_vae, never hardcoded. WEIGHT_DTYPE is bfloat16 today and would be wrong the moment a quantised load lands, which is queued. The VAE knows its own dtype the same way it knows its own config keys…5aa5d7b -
feat: build the mel front-end the checkpoint does not ship
Unverified signatureThe audio VAE has no mel front-end and upstream ships none anywhere in diffusers.pipelines.ltx2 -- the vocoder's only hann window belongs to its anti-aliasing filter. So audio_to_audio and audio_to_video could not start, while H5-H9 produce real audio: decode needs no STFT, because the VAE decoder emits a mel and the vocoder inverts it. The gap is asymmetric by nature. Five parameters, each read from the component that owns it. Four are declared by BOTH components and agree -- mel bins 64 = num_mel_channels 64, sample_rate 16000 = input_sampling_rate 16000 -- which is what makes this a lookup rather than a reconstruction. The hop is the single disagreement and is read from the VAE on purpose: mel_hop_length 160 against the vocoder's hop_length 80, and the vocoder's own upsample_factors [5,2,2,2,2,2] multiply to 160, matching the VAE rather than its own declared 80. Read window_length across; do NOT read a hop across. The asymmetry is the judgement and it is what a later reader will t…a380070 -
fix: read the audio VAE's parameters from where they actually are
Unverified signatureBLOCKER, found offline before the card hit it. audio_params_from() read six names off audio_vae.config and NOT ONE OF THEM EXISTS THERE. Four are config keys under different names and two are instance attributes set in the model's __init__, absent from config.json entirely: audio_sampling_rate -> config.sample_rate (16000) audio_hop_length -> config.mel_hop_length (160) audio_mel_bins -> config.mel_bins (64) audio_latent_channels -> config.latent_channels (8) audio_vae_mel_compression_ratio -> model.mel_compression_ratio (4) audio_vae_temporal_compression_ratio -> model.temporal_compression_ratio So every runtime path through this module raised on real weights -- the audio-input encode built two commits ago included -- while passing offline against a fake that used our names. The fake agreed with the code and with nothing else. Third instance today of a fixture e…b0b9928 -
fix: the audio a user uploads must reach the model
Unverified signatureThere is no audio= argument on any LTX2 pipeline: audio enters as pre-encoded audio_latents. The UI wrote request.audio, modes._with_audio read request.audio_latents, and NOTHING JOINED THEM. Both ends were built. encode_waveform_to_latents existed, was exported and documented, and had an importer count of zero. So audio_to_audio and audio_to_video discarded the upload and generated fresh audio. The run succeeded, the artifact was valid, every test passed, and only the user's own ears would ever have told them -- while the field's help text said 'Encoded to audio latents before the call', describing a step that did not exist. Resilience lesson 2 inverted: a silent success. generate._prepared_audio joins them, after the pipeline exists because the encode needs its audio_vae. A mode given audio with no audio_vae to encode it now refuses loudly rather than generating a plausible track nobody asked for. audio.load_waveform reads the file gr.Audio(type='filepath') hands us. The fixtures …cbfbe87 -
test: spec validator stages 5.5 and 6.5, and the revised stage 4
Follows the PLAN amendment. Stage 7 is necessary but not sufficient: an LTX-Video-2B adapter whose module names match ours attaches to >0 modules and passes it, and only a per-module dimension comparison catches it. The fixtures now carry real dimensions, including the two-stream shape (video 4096, audio 2048, 4x feed-forward expansions), so the spec can require that a 2048 tensor at an audio module is accepted while a 2048 tensor at a video module is rejected. A rule that just looks for 2048 would reject the most-downloaded LTX LoRA on the Hub. Also relaxes the hardcoded-filename sweep: it now flags string literals that ARE filenames, not prose in the UI layer that mentions the extension.d86776a -
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 -
test: spec errors, constraints, model_files and the LoRA validator
Red-first specs for PLAN §4.3 (7-stage LoRA validator), §5.2 (single source of truth for Hub coordinates), §5.5 (frame/dimension constraints) and the error hierarchy. Runs with no GPU, no network and no model weights: safetensors fixtures are synthesised byte-for-byte in pure Python, which is also the only way to craft the truncated and corrupt-header files stage 3 has to distinguish.5861856