Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files265 unmodified lines26626726826927027127227327427527627727827926927027155 unmodified lines327328329330331332333334335336337338339340265 unmodified linesprint("Downloading LTX-2.3 distilled model + Gemma...")print("=" * 80)
# ----------------------------# Pipeline cache for LoRA strengths (keeps at most 2 pipelines to limit VRAM)# ----------------------------# Use rounded strengths as keys (2 decimal places)pipeline_cache: OrderedDict[float, LTX23DistilledA2VPipeline] = OrderedDict()# Record the current pipeline's LoRA strength (we built the module above with lora_descriptor default 1.0)current_lora_strength: float = round(1.0, 2)pipeline_cache[current_lora_strength] = pipelineCACHE_MAX_SIZE = 2 # keep at most two pipeline instances in memoryprint(f"[CACHE] initialized pipeline cache with strength={current_lora_strength}")
checkpoint_path = hf_hub_download(repo_id=LTX_MODEL_REPO, filename="ltx-2.3-22b-distilled.safetensors")spatial_upsampler_path = hf_hub_download(repo_id=LTX_MODEL_REPO, filename="ltx-2.3-spatial-upscaler-x2-1.0.safetensors")gemma_root = snapshot_download(repo_id=GEMMA_REPO)55 unmodified linesprint("Pipeline ready!")print("=" * 80)
# ----------------------------# Pipeline cache for LoRA strengths (keeps at most 2 pipelines to limit VRAM)# ----------------------------pipeline_cache: OrderedDict[float, LTX23DistilledA2VPipeline] = OrderedDict()current_lora_strength: float = round(1.0, 2)pipeline_cache[current_lora_strength] = pipelineCACHE_MAX_SIZE = 2print(f"[CACHE] initialized pipeline cache with strength={current_lora_strength}")
def log_memory(tag: str): if torch.cuda.is_available():app.py+8-11