Views
No views yet
LTX-Video model from Hugging Face's diffusers library. The model is fine-tuned with LoRA weights for the "Pixel Art" style, as demonstrated in this example.pip install torch diffusers safetensors peftLTX-Video model with the "Pixel Art" style.1import torch
2from diffusers import LTXPipeline
3from diffusers.utils import export_to_video1# Load the LTX-Video model with bfloat16 precision
2pipe = LTXPipeline.from_pretrained("Lightricks/LTX-Video", torch_dtype=torch.bfloat16)
3
4# Load LoRA weights for the "Pixel Art" style
5pipe.load_lora_weights("ltx_pixel_pytorch_lora_weights.safetensors", "pixel")
6
7# Set the adapter with a strength of 2.0
8pipe.set_adapters("pixel", 2.0)
9
10# Move the model to the GPU for faster inference
11pipe.to("cuda")1# Define the text prompt
2prompt = "In the style of Pixel, Golden light filters through the canopy, illuminating soft moss and fallen leaves. Wildflowers bloom nearby, and glowing fireflies hover in the air. A gentle stream flows in the background, its murmur blending with birdsong. The scene radiates tranquility and natural charm."
3
4# Define the negative prompt to avoid undesirable qualities
5negative_prompt = "worst quality, inconsistent motion, blurry, jittery, distorted"
6
7# Generate the video
8video = pipe(
9 prompt=prompt,
10 negative_prompt=negative_prompt,
11 width=704,
12 height=480,
13 num_frames=161,
14 num_inference_steps=50,
15).frames[0]
16
17# Export the video to a file
18export_to_video(video, "output.mp4", fps=24)1# Display the generated video in a Jupyter notebook
2from IPython import display
3display.Video("output.mp4")In the style of Pixel,prompt = "In the style of Pixel, Golden light filters through the canopy, illuminating soft moss and fallen leaves. Wildflowers bloom nearby, and glowing fireflies hover in the air. A gentle stream flows in the background, its murmur blending with birdsong. The scene radiates tranquility and natural charm."prompt = "In the style of Pixel, the video shifts to a majestic castle under a starry sky. Silvery moonlight bathes the ancient stone walls, casting soft shadows on the surrounding landscape. Towering spires rise into the night, their peaks adorned with glowing orbs that mimic the stars above. A tranquil moat reflects the shimmering heavens, its surface rippling gently in the cool breeze. Fireflies dance around the castle’s ivy-covered arches, adding a touch of magic to the scene. In the distance, a faint aurora paints the horizon with hues of green and purple, blending seamlessly with the celestial tapestry. The scene exudes an aura of timeless wonder and serene beauty."prompt = "In the style of Pixel, the video showcases a vibrant urban landscape. The city skyline is dominated by towering skyscrapers, their glass facades reflecting the sunlight. The streets are bustling with activity, filled with cars, buses, and pedestrians. Parks and green spaces are scattered throughout, offering a refreshing contrast to the concrete jungle. The architecture is a mix of modern and historic buildings, each telling a story of the city's evolution. The overall scene is alive with energy, capturing the essence of urban life."LTX-Video model with the "Pixel Art" style. By adjusting the prompts and parameters, you can create a wide variety of pixel art video content tailored to your needs.