Downloads · 30 days
10
7% of all-time downloads
dg845/LTX-2-Latent-Upsampler-Diffusers
LTX-2-Latent-Upsampler-Diffusers is a image-to-video model from dg845. Use it for the image-to-video task on the model card, and read the license before you ship it in a product. It is set up for diffusers.
This repo contains a checkpoint for the diffusers LTX-2 latent upsampling pipeline LTX2LatentUpsamplerModel, which upsamples the first-stage video latents as part of two-stage inference.
Downloads · 30 days
10
7% of all-time downloads
All-time downloads
136
Public
Repo size
3.4 GB
Likes
0
Public
Click a slice to open those files.
.safetensors3.4 GB · 100%
From the Hugging Face model README
This repo contains a checkpoint for the diffusers LTX-2 latent upsampling pipeline LTX2LatentUpsamplerModel, which upsamples the first-stage video latents as part of two-stage inference.
A usage example is as follows:
import torch
from diffusers import LTX2ImageToVideoPipeline, LTX2LatentUpsamplePipeline
from diffusers.pipelines.ltx2.export_utils import encode_video
pipe = LTX2Pipeline.from_pretrained("Lightricks/LTX-2", torch_dtype=torch.bfloat16)
pipe.enable_model_cpu_offload()
image = load_image(
"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/astronaut.jpg"
)
prompt = "An astronaut hatches from a fragile egg on the surface of the Moon, the shell cracking and peeling apart in gentle low-gravity motion. Fine lunar dust lifts and drifts outward with each movement, floating in slow arcs before settling back onto the ground. The astronaut pushes free in a deliberate, weightless motion, small fragments of the egg tumbling and spinning through the air. In the background, the deep darkness of space subtly shifts as stars glide with the camera's movement, emphasizing vast depth and scale. The camera performs a smooth, cinematic slow push-in, with natural parallax between the foreground dust, the astronaut, and the distant starfield. Ultra-realistic detail, physically accurate low-gravity motion, cinematic lighting, and a breath-taking, movie-like shot."
negative_prompt = "shaky, glitchy, low quality, worst quality, deformed, distorted, disfigured, motion smear, motion artifacts, fused fingers, bad anatomy, weird hand, ugly, transition, static."
# First-Stage I2V inference
frame_rate = 24.0
video, audio = pipe(
image=image,
prompt=prompt,
negative_prompt=negative_prompt,
width=768,
height=512,
num_frames=121,
frame_rate=frame_rate,
num_inference_steps=40,
guidance_scale=4.0,
output_type="pil",
return_dict=False,
)
upsample_pipe = LTX2LatentUpsamplePipeline.from_pretrained(
"dg845/LTX-2-Latent-Upsampler-Diffusers", torch_dtype=torch.bfloat16
)
upsample_pipe.vae.enable_tiling()
upsample_pipe.to("cuda")
# Latent Upsampling
video = upsample_pipe(
video=video,
width=768,
height=512,
output_type="np",
return_dict=False,
)[0]
video = (video * 255).round().astype("uint8")
video = torch.from_numpy(video)
encode_video(
video[0],
fps=frame_rate,
audio=audio[0].float().cpu(),
audio_sample_rate=pipe.vocoder.config.output_sampling_rate,
output_path="ltx2_sample.mp4",
)