Spaces:
Runtime error
Runtime error
Update app.py
Browse files93 unmodified lines94959697979899100101102103104104105106107108109110111111112113114172 unmodified lines28728828929029029129229330 unmodified lines32432532632732732832933033133293 unmodified lines sampler=PIPELINE_CONFIG_YAML["sampler"], # "from_checkpoint" or specific sampler device=DEVICE, enhance_prompt=False, # Assuming Gradio controls this, or set based on YAML later)).to(torch.bfloat16)
# Create Latent Upsamplerlatent_upsampler = create_latent_upsampler( latent_upsampler_model_path=spatial_upsampler_path, device=DEVICE)latent_upsampler = latent_upsampler.to(torch.bfloat16 if PIPELINE_CONFIG_YAML["precision"] == "bfloat16" else torch.float32)latent_upsampler = latent_upsampler.to(torch.bfloat16)
# Multi-scale pipeline (wrapper)multi_scale_pipe = LTXMultiScalePipeline( video_pipeline=pipe, latent_upsampler=latent_upsampler)).to(torch.bfloat16)# --- End Global Configuration & Model Loading ---
172 unmodified lines "output_type": "latent" } latents = pipe(**first_pass_args).images # .images here is actually latents
print("First pass done!") # 2. Upsample latents manually # Need to handle normalization around latent upsampler if it expects unnormalized latents latents_unnorm = un_normalize_latents(latents, pipe.vae, vae_per_channel_normalize=True)30 unmodified lines decode_noise_val = PIPELINE_CONFIG_YAML.get("decode_noise_scale", 0.025) upsampled_latents = upsampled_latents * (1 - decode_noise_val) + noise * decode_noise_val
print("before vae decoding") result_frames_tensor = pipe.vae.decode(upsampled_latents, **decode_kwargs).sample print("after vae decoding?") # result_frames_tensor shape: (B, C, F_video, H_video, W_video)
# --- Post-processing: Cropping and Converting to PIL ---app.py+6-5