| """User-editable Hugging Face Space configuration for the LTX-2.5 app. |
| |
| This file is the supported customization surface for forks. Runtime invariants, |
| ZeroGPU quota logic, quantization safety checks, UUID isolation, and fallback |
| implementation intentionally remain outside this customization surface in |
| ``app.py`` and the ``ltx/`` runtime modules. |
| |
| Model/component overrides are best-effort. If an override cannot be loaded or |
| integrated, the app logs the failure and falls back to the corresponding base |
| component. If the configured base model itself is unusable, the app falls back |
| to the pinned canonical LTX-2.5 Diffusers repository. The effective runtime |
| sources are always exposed in the UI and diagnostics; fallback is never silent. |
| """ |
|
|
| |
| |
| |
|
|
| |
| |
| MODEL_REPO_ID = "Lightricks/LTX-2.5-Diffusers" |
| MODEL_REVISION = "549f18015d588ce728aad02aebff9212d94f598e" |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| MODEL_QUANTIZATION_POLICY = "nf4_auto" |
|
|
|
|
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| MODEL_RUNTIME_PROFILE = "distilled_nf4" |
|
|
| |
| |
| |
| ZEROGPU_GPU_SIZE = "large" |
|
|
| |
| |
| |
| |
| FULL_SFT_TRANSFORMER_REPO_ID = None |
| FULL_SFT_TRANSFORMER_REVISION = None |
| FULL_SFT_TRANSFORMER_PATH = "transformer_full" |
|
|
| |
| |
| FULL_SFT_STAGE2_LORA_REPO_ID = None |
| FULL_SFT_STAGE2_LORA_REVISION = None |
| FULL_SFT_STAGE2_LORA_WEIGHT_NAME = "ltx-2.5-22b-distilled-lora-450-bf16.safetensors" |
| FULL_SFT_STAGE2_LORA_STRENGTH = 1.0 |
|
|
|
|
| |
| |
| |
|
|
| |
| |
| |
| A2V_ENABLED = True |
| A2V_WIDTH = 512 |
| A2V_HEIGHT = 512 |
| A2V_FRAMES = 121 |
| A2V_ZEROGPU_DURATION_SECONDS = 110 |
|
|
| |
| |
| |
| A2V_EXAMPLE_SPECS = [ |
| { |
| "label": "Puppet superhero wakes up · image + audio", |
| "repo_id": "alexnasa/ltx-2-TURBO", |
| "repo_type": "space", |
| "revision": "72ca15061ee5db3fad4b773c016c6910d184a597", |
| "image": "supergirl-2.png", |
| "audio": "supergirl.m4a", |
| "prompt": ( |
| "A fuzzy puppet superhero character resembling a female puppet with blonde hair and a blue superhero suit " |
| "sleeping in bed and just waking up, she gradually gets up, rubbing her eyes and looking at her dog that " |
| "just popped on the bed. the scene feels chaotic, comedic, and emotional with expressive puppet reactions, " |
| "cinematic lighting, smooth camera motion, shallow depth of field, and high-quality puppet-style animation" |
| ), |
| "attribution": "alexnasa/ltx-2-TURBO S2V example", |
| }, |
| ] |
|
|
|
|
| |
| |
| |
|
|
| |
| TRANSFORMER_OVERRIDE_REPO_ID = None |
|
|
| |
| |
| |
| TRANSFORMER_OVERRIDE_PATH = None |
| TRANSFORMER_OVERRIDE_REVISION = None |
|
|
|
|
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| TEXT_ENCODER_OVERRIDE_REPO_ID = None |
|
|
| |
| TEXT_ENCODER_OVERRIDE_PATH = None |
| TEXT_ENCODER_OVERRIDE_REVISION = None |
|
|
|
|
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| PROMPT_ENHANCER_ENABLED = True |
| PROMPT_ENHANCER_REPO_ID = "unsloth/gemma-4-E2B-it" |
| PROMPT_ENHANCER_REVISION = "9e469bd761461de321e0ba2ec3a00bced655f881" |
|
|
| |
| |
| |
| PROMPT_ENHANCER_QUANTIZATION_POLICY = "nf4_auto" |
|
|
| |
| |
| |
| PROMPT_TOOL_ZEROGPU_DURATION_SECONDS = 30 |
|
|
| |
| |
| |
| PROMPT_TRANSLATE_LTX_ENGLISH_SYSTEM_PROMPT = """ |
| You are a translation assistant for LTX-2.5 video-generation prompts. Translate the user's input into natural, precise English while preserving its meaning, chronology, names, numbers, visual details, camera instructions, audio instructions, and exact quoted dialogue. Do not add new creative content, remove requested content, or change the intended scene. If the input is already English, only normalize wording when needed for clarity. Keep visual and audio descriptions literal and concrete. Return exactly one continuous English paragraph suitable for LTX-2.5, with no title, preface, bullet list, Markdown, code fence, or commentary. |
| """.strip() |
|
|
| PROMPT_WRITE_FROM_SEED_SYSTEM_PROMPT = """ |
| You are an LTX-2.5 video-prompt writer. Turn the user's seed idea, keywords, fragment, or rough concept into one complete English video-generation prompt. Preserve every explicit seed constraint, then invent useful missing visual, motion, setting, lighting, texture, and sound details so the result is concrete and chronologically coherent. Use active present-progressive language. Do not invent dialogue unless the seed mentions speech, talking, singing, or conversation; preserve any supplied dialogue exactly except obvious typos. Do not invent camera movement unless the seed requests it. Describe only visual and audible information. Prefer a single flowing paragraph under about 200 words. Return only the finished prompt, with no title, preface, Markdown, code fence, or commentary. |
| """.strip() |
|
|
|
|
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| AUTO_DURATION_ENABLED = True |
| DEFAULT_USE_AUTO_DURATION = False |
| AUTO_DURATION_MIN_SECONDS = 1.0 |
| AUTO_DURATION_MAX_SECONDS = 8.0 |
|
|
|
|
| |
| |
| |
|
|
| |
| |
| |
| DIFFUSION_DECODER_ENABLED = True |
| DEFAULT_USE_DIFFUSION_DECODER = False |
|
|
|
|
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| BUILTIN_LORAS = [ |
| { |
| "label": "[Probe] Motion Stabilizer · LTX-2.3", |
| "repo_id": "vpakarinen/motion-stabilizer-ltx-lora", |
| "weight_name": "motion_stabilizer_ltx_lora_v2.safetensors", |
| "revision": "14f0bf50218894ea134e6d22904653a363290677", |
| }, |
| ] |
| DEFAULT_SELECTED_LORAS = [] |
| DEFAULT_LORA_STRENGTH = 1.0 |
|
|
| |
| |
| |
|
|
| |
| |
| |
| IC_COLORIZER_ENABLED = True |
| IC_COLORIZER_LORA_REPO_ID = "Lightricks/LTX-2.3-22b-IC-LoRA-Colorization" |
| IC_COLORIZER_LORA_REVISION = "0151def1e9b5cf612023c482c24a5df23445ca3f" |
| IC_COLORIZER_LORA_WEIGHT_NAME = "ltx-2.3-22b-ic-lora-colorization-0.9.safetensors" |
| IC_COLORIZER_LORA_STRENGTH = 1.0 |
| IC_COLORIZER_REFERENCE_DOWNSCALE_FACTOR = 1 |
| IC_COLORIZER_REFERENCE_STRENGTH = 1.0 |
| IC_COLORIZER_CONDITIONING_ATTENTION_STRENGTH = 1.0 |
|
|
| |
| |
| |
| IC_COLORIZER_DEFAULT_PROFILE = "Donor fast · 768×448 · 49f" |
| IC_COLORIZER_PROFILES = { |
| "Probe · 512×512 · 25f": { |
| "width": 512, |
| "height": 512, |
| "num_frames": 25, |
| "zerogpu_duration_seconds": 20, |
| "calibration_status": "live callbacks ~9.8-10.1s; calibrated product reservation 20s", |
| }, |
| "Donor fast · 768×448 · 49f": { |
| "width": 768, |
| "height": 448, |
| "num_frames": 49, |
| "zerogpu_duration_seconds": 30, |
| "calibration_status": "live callback 19.374s with maintainer visual PASS; calibrated product reservation 30s", |
| }, |
| } |
|
|
| |
| |
| |
|
|
| |
| |
| |
| |
| IC_PIXEL_UPSCALER_ENABLED = True |
| IC_PIXEL_UPSCALER_LORA_REPO_ID = "Lightricks/LTX-2.5-22b-IC-LoRA-Pixel-Spatial-Upscaler" |
| IC_PIXEL_UPSCALER_LORA_REVISION = "c8140e3c0b838f883ed527e97014700ba51bfea8" |
| IC_PIXEL_UPSCALER_LORA_WEIGHT_NAME = "ltx-2.5-22b-ic-lora-pixel-spatial-upscaler-x2-1.0.safetensors" |
| IC_PIXEL_UPSCALER_LORA_STRENGTH = 1.0 |
| IC_PIXEL_UPSCALER_REFERENCE_DOWNSCALE_FACTOR = 2 |
| IC_PIXEL_UPSCALER_REFERENCE_STRENGTH = 1.0 |
| IC_PIXEL_UPSCALER_CONDITIONING_ATTENTION_STRENGTH = 1.0 |
| IC_PIXEL_UPSCALER_MAX_DURATION_SECONDS = 3.0 |
| IC_PIXEL_UPSCALER_MAX_OUTPUT_SIDE = 768 |
| IC_PIXEL_UPSCALER_ZEROGPU_DURATION_SECONDS = 55 |
|
|
| |
| |
| |
| IC_PIXEL_UPSCALER_EXAMPLE_SPECS = [ |
| { |
| "label": "Jellyfish · official upscaler donor", |
| "repo_id": "Lightricks/ltx-2-3-spatial-upscaler", |
| "repo_type": "space", |
| "revision": "125b50558f2fa7185deeabf9b3504ec9ced24ab1", |
| "video": "jellyfish_glide.mp4", |
| "prompt": "a jellyfish gliding gracefully through deep blue water, translucent bioluminescent detail", |
| "attribution": "Official Lightricks LTX-2.3 Pixel Spatial Upscaler demo media", |
| }, |
| { |
| "label": "Waterfall · official upscaler donor", |
| "repo_id": "Lightricks/ltx-2-3-spatial-upscaler", |
| "repo_type": "space", |
| "revision": "125b50558f2fa7185deeabf9b3504ec9ced24ab1", |
| "video": "waterfall_forest.mp4", |
| "prompt": "a waterfall cascading through a lush green forest, misty spray and wet mossy rocks", |
| "attribution": "Official Lightricks LTX-2.3 Pixel Spatial Upscaler demo media", |
| }, |
| { |
| "label": "Squirrel · official upscaler donor", |
| "repo_id": "Lightricks/ltx-2-3-spatial-upscaler", |
| "repo_type": "space", |
| "revision": "125b50558f2fa7185deeabf9b3504ec9ced24ab1", |
| "video": "squirrel_eating.mp4", |
| "prompt": "a squirrel eating a nut, detailed fur, soft natural daylight", |
| "attribution": "Official Lightricks LTX-2.3 Pixel Spatial Upscaler demo media", |
| }, |
| ] |
|
|
|
|
| |
| |
| |
|
|
| |
| |
| |
| |
| IC_INOUTPAINT_ENABLED = True |
| IC_INOUTPAINT_LORA_REPO_ID = "Lightricks/LTX-2.3-22b-IC-LoRA-In-Outpainting" |
| IC_INOUTPAINT_LORA_REVISION = None |
| IC_INOUTPAINT_LORA_WEIGHT_NAME = "ltx-2.3-22b-ic-lora-in-outpainting-0.9.safetensors" |
| IC_INOUTPAINT_LORA_STRENGTH = 1.0 |
| IC_INOUTPAINT_REFERENCE_DOWNSCALE_FACTOR = 1 |
| IC_INOUTPAINT_REFERENCE_STRENGTH = 1.0 |
| IC_INOUTPAINT_CONDITIONING_ATTENTION_STRENGTH = 1.0 |
| IC_INOUTPAINT_MAX_DURATION_SECONDS = 2.0 |
| IC_INOUTPAINT_MAX_OUTPUT_SIDE = 768 |
| IC_INOUTPAINT_ZEROGPU_DURATION_SECONDS = 40 |
|
|
| |
| |
| IC_INOUTPAINT_EXAMPLE_SPECS = [ |
| { |
| "label": "Jellyfish · official Lightricks source", |
| "repo_id": "Lightricks/ltx-2-3-spatial-upscaler", |
| "repo_type": "space", |
| "revision": "125b50558f2fa7185deeabf9b3504ec9ced24ab1", |
| "video": "jellyfish_glide.mp4", |
| "prompt": "", |
| "mode": "Outpainting", |
| "layout": "Wide · 768×448", |
| "attribution": "Official Lightricks demo media reused only as an Outpainting source witness", |
| } |
| ] |
|
|
|
|
| |
| |
| |
| |
| IC_COLORIZER_EXAMPLE_SPECS = [ |
| { |
| "label": "Rabbit on rocks · old Colorizer donor", |
| "repo_id": "ltx-community/ltx-2.3-colorize", |
| "repo_type": "space", |
| "revision": "main", |
| "video": "examples/rabbit_rocks_gray.mp4", |
| "profile": "Donor fast · 768×448 · 49f", |
| "prompt": ( |
| "a young brown cottontail rabbit with warm tan and grey-brown fur, a pale cream " |
| "underside and soft pink inner ears, perched on weathered grey granite boulders " |
| "flecked with green and ochre lichen, with bleached driftwood and clumps of golden " |
| "dry grass in warm late-afternoon sun; gentle wind, distant birdsong and soft " |
| "rustling grass" |
| ), |
| "attribution": "LTX-2.3 Colorize donor example", |
| } |
| ] |
|
|
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| IC_LORA_PRESET_CATALOG = [ |
| { |
| "label": "Colorization · official LTX-2.3 IC-LoRA", |
| "repo_id": "Lightricks/LTX-2.3-22b-IC-LoRA-Colorization", |
| "weight_name": "ltx-2.3-22b-ic-lora-colorization-0.9.safetensors", |
| "revision": "", |
| "workflow_family": "ic_reference_video_colorization", |
| "ui_exposed": False, |
| "access": "gated", |
| "source": "megapack:ltx23_ic_colorizer", |
| }, |
| { |
| "label": "HDR · official LTX-2.3 IC-LoRA", |
| "repo_id": "Lightricks/LTX-2.3-22b-IC-LoRA-HDR", |
| "weight_name": "ltx-2.3-22b-ic-lora-hdr-0.9.safetensors", |
| "revision": "", |
| "workflow_family": "ic_reference_video_hdr", |
| "ui_exposed": False, |
| "access": "gated", |
| "source": "megapack:ltx_lora_playground", |
| }, |
| { |
| "label": "Motion Track Control · official LTX-2.3 IC-LoRA", |
| "repo_id": "Lightricks/LTX-2.3-22b-IC-LoRA-Motion-Track-Control", |
| "weight_name": "ltx-2.3-22b-ic-lora-motion-track-control-ref0.5.safetensors", |
| "revision": "572bb9c", |
| "workflow_family": "ic_reference_video_motion_track", |
| "reference_downscale_factor": 2, |
| "ui_exposed": False, |
| "access": "public", |
| "source": "megapack:ltx_lora_playground + web-verified-current", |
| }, |
| { |
| "label": "Union Control · official LTX-2.3 IC-LoRA", |
| "repo_id": "Lightricks/LTX-2.3-22b-IC-LoRA-Union-Control", |
| "weight_name": "ltx-2.3-22b-ic-lora-union-control-ref0.5.safetensors", |
| "revision": "b4d1c4d", |
| "workflow_family": "ic_reference_video_union_control", |
| "reference_downscale_factor": 2, |
| "ui_exposed": False, |
| "access": "public", |
| "source": "megapack:ltx_lora_playground + web-verified-current", |
| }, |
| { |
| "label": "Outpaint · LTX-2.3 IC-LoRA", |
| "repo_id": "oumoumad/LTX-2.3-22b-IC-LoRA-Outpaint", |
| "weight_name": "ltx-2.3-22b-ic-lora-outpaint.safetensors", |
| "revision": "b747e10", |
| "workflow_family": "ic_reference_video_outpaint", |
| "ui_exposed": False, |
| "access": "public", |
| "source": "megapack:ltx_lora_playground + web-verified-current", |
| }, |
| { |
| "label": "Video Restoration · JoyFox LTX-2.3 ICEdit", |
| "repo_id": "joyfox/LTX2.3-ICEdit-Insight", |
| "weight_name": "ltx2.3-video-restoration-general.safetensors", |
| "revision": "", |
| "workflow_family": "joyfox_insight_video_edit", |
| "ui_exposed": False, |
| "access": "public", |
| "source": "megapack:ltx_lora_playground", |
| }, |
| { |
| "label": "HD Enhancement · JoyFox LTX-2.3 ICEdit", |
| "repo_id": "joyfox/LTX2.3-ICEdit-Insight", |
| "weight_name": "ltx2.3-ic-video-upscale-general.safetensors", |
| "revision": "", |
| "workflow_family": "joyfox_insight_video_edit", |
| "ui_exposed": False, |
| "access": "public", |
| "source": "megapack:ltx_lora_playground", |
| }, |
| { |
| "label": "Watermark Removal · JoyFox LTX-2.3 ICEdit", |
| "repo_id": "joyfox/LTX2.3-ICEdit-Insight", |
| "weight_name": "ltx2.3-ic-watermark-remove-general.safetensors", |
| "revision": "", |
| "workflow_family": "joyfox_insight_video_edit", |
| "ui_exposed": False, |
| "access": "public", |
| "source": "megapack:ltx_lora_playground", |
| }, |
| { |
| "label": "Subtitle Removal · JoyFox LTX-2.3 ICEdit", |
| "repo_id": "joyfox/LTX2.3-ICEdit-Insight", |
| "weight_name": "ltx2.3-ic-subtitles-remove-general.safetensors", |
| "revision": "", |
| "workflow_family": "joyfox_insight_video_edit", |
| "ui_exposed": False, |
| "access": "public", |
| "source": "megapack:ltx_lora_playground", |
| }, |
| ] |
|
|
|
|
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| EXAMPLE_SPECS = [ |
| { |
| "label": "Cats · I2V", |
| "repo_id": "huggingface/documentation-images", |
| "repo_type": "dataset", |
| "revision": "main", |
| "start_image": "diffusers/coco-cats.png", |
| "end_image": None, |
| "prompt": ( |
| "A pair of tabby cats resting on a bright pink sofa; one cat slowly lifts its head and stretches " |
| "while the other shifts gently, natural indoor room tone, steady camera." |
| ), |
| "license": "CC BY-NC-SA 4.0", |
| "attribution": "Hugging Face documentation-images", |
| }, |
| { |
| "label": "Blue bird · I2V", |
| "repo_id": "huggingface/documentation-images", |
| "repo_type": "dataset", |
| "revision": "main", |
| "start_image": "diffusers/flf2v_input_first_frame.png", |
| "end_image": None, |
| "prompt": ( |
| "CG animation style, a small blue bird takes off from the ground, flapping its wings. " |
| "The camera follows the bird upward through a bright blue sky with soft clouds; delicate " |
| "wing motion, stable composition, and light natural ambience." |
| ), |
| "license": "CC BY-NC-SA 4.0", |
| "attribution": "Hugging Face documentation-images", |
| }, |
| { |
| "label": "Blue bird · first + last frame", |
| "repo_id": "huggingface/documentation-images", |
| "repo_type": "dataset", |
| "revision": "main", |
| "start_image": "diffusers/flf2v_input_first_frame.png", |
| "end_image": "diffusers/flf2v_input_last_frame.png", |
| "prompt": ( |
| "CG animation style, a small blue bird takes off from the ground, flapping its wings. " |
| "The camera follows the bird upward, smoothly connecting the supplied first and last frames " |
| "with coherent motion and synchronized light natural ambience." |
| ), |
| "license": "CC BY-NC-SA 4.0", |
| "attribution": "Hugging Face documentation-images", |
| }, |
| { |
| "label": "Kingfisher · official LTX-2.5", |
| "repo_id": "Lightricks/LTX-2.5", |
| "repo_type": "space", |
| "revision": "e1c94ba", |
| "start_image": "examples/bird_kingfisher.jpg", |
| "end_image": None, |
| "prompt": ( |
| "The kingfisher launches from the branch and skims low over the water, wings beating fast, " |
| "droplets trailing behind" |
| ), |
| "attribution": "Official Lightricks LTX-2.5 Space example", |
| }, |
| { |
| "label": "Aurora · official LTX-2.5", |
| "repo_id": "Lightricks/LTX-2.5", |
| "repo_type": "space", |
| "revision": "e1c94ba", |
| "start_image": "examples/aurora.jpg", |
| "end_image": None, |
| "prompt": ( |
| "The green aurora ripples across the starry night sky above the snow-capped mountains, wind gusting" |
| ), |
| "attribution": "Official Lightricks LTX-2.5 Space example", |
| }, |
| { |
| "label": "Cherry blossom pond · official LTX-2.5", |
| "repo_id": "Lightricks/LTX-2.5", |
| "repo_type": "space", |
| "revision": "e1c94ba", |
| "start_image": "examples/cherry_blossom_pond.jpg", |
| "end_image": None, |
| "prompt": "Pink cherry-blossom petals drift down and gently ripple the calm pond", |
| "attribution": "Official Lightricks LTX-2.5 Space example", |
| }, |
| ] |
|
|
| |
| HISTORY_LIMIT = 5 |
|
|
|
|
| |
| |
| |
|
|
| |
| |
| |
| |
| FRAME_RATE = 24.0 |
| STANDARD_MAX_SECONDS = 15.0 |
| EXPERIMENTAL_MAX_SECONDS = 30.0 |
| RESOLUTIONS = { |
| "512 × 512 · validated": (512, 512), |
| "768 × 512 · experimental": (768, 512), |
| "512 × 768 · experimental": (512, 768), |
| } |
|
|
| DEFAULT_PROMPT = ( |
| "A small red fox walks slowly through fresh snow at dawn while the camera " |
| "tracks beside it; soft wind moves the trees and quiet footsteps are audible." |
| ) |
| DEFAULT_RESOLUTION = "512 × 512 · validated" |
| DEFAULT_DURATION_SECONDS = 1.0 |
| DEFAULT_SEED = 42 |
| DEFAULT_RANDOMIZE_SEED = True |
|
|
| |
| |
| DEFAULT_ATTENTION_BACKEND = "sdpa" |
|
|