Spaces:
Running on Zero
Running on Zero
fix
Browse files
app.py
CHANGED
|
@@ -285,11 +285,20 @@ def _install_aoti():
|
|
| 285 |
return video, audio
|
| 286 |
velocity._process_transformer_blocks = _types.MethodType(_proc, velocity)
|
| 287 |
print(f"[AOTI] loaded {AOTI_REPO} + patched block loop", flush=True)
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 293 |
# ==============================================================================================
|
| 294 |
|
| 295 |
|
|
@@ -317,8 +326,11 @@ def colorize_video(video, scene_description, color_description, preset, num_fram
|
|
| 317 |
# This is also the identity-safe colorization recipe recommended for this LoRA.
|
| 318 |
gen_w, gen_h = (width * 2, height * 2) if SKIP_STAGE_2 else (width, height)
|
| 319 |
|
|
|
|
|
|
|
|
|
|
| 320 |
video_out, audio_out = pipeline(
|
| 321 |
-
prompt=
|
| 322 |
seed=seed, height=gen_h, width=gen_w,
|
| 323 |
num_frames=num_frames, frame_rate=FPS,
|
| 324 |
images=[], video_conditioning=[(ref_path, 1.0)],
|
|
@@ -338,7 +350,7 @@ with gr.Blocks(title=TITLE) as demo:
|
|
| 338 |
"with the [Colorization IC-LoRA](https://huggingface.co/Lightricks/LTX-2.3-22b-IC-LoRA-Colorization)."
|
| 339 |
)
|
| 340 |
gr.Markdown(
|
| 341 |
-
"
|
| 342 |
"Note: the Colorization LoRA is not a true deblur/denoise/decompression/upscaling model. The old-film and high-detail options below are prompt hints only; "
|
| 343 |
"for heavy restoration, use a dedicated deblur/decompression pass before or after colorization."
|
| 344 |
)
|
|
|
|
| 285 |
return video, audio
|
| 286 |
velocity._process_transformer_blocks = _types.MethodType(_proc, velocity)
|
| 287 |
print(f"[AOTI] loaded {AOTI_REPO} + patched block loop", flush=True)
|
| 288 |
+
# For IC-LoRA task adapters, keep AOTI OFF by default. AOTI can replace the
|
| 289 |
+
# transformer block execution with a precompiled graph that may not include the
|
| 290 |
+
# currently fused IC-LoRA weights. Symptom: the output follows the reference
|
| 291 |
+
# weakly / changes motion but stays grayscale, i.e. the Colorization LoRA is
|
| 292 |
+
# effectively bypassed. Set USE_AOTI=1 only after verifying the LoRA effect.
|
| 293 |
+
USE_AOTI = os.environ.get("USE_AOTI", "0") == "1"
|
| 294 |
+
print(f"[AOTI] base torch={torch.__version__} cuda={torch.version.cuda} enabled={USE_AOTI}", flush=True)
|
| 295 |
+
if USE_AOTI:
|
| 296 |
+
try:
|
| 297 |
+
_install_aoti(); print("[AOTI] OK", flush=True)
|
| 298 |
+
except Exception as _e:
|
| 299 |
+
import traceback; traceback.print_exc(); print(f"[AOTI] FAILED ({_e!r}) -> EAGER", flush=True)
|
| 300 |
+
else:
|
| 301 |
+
print("[AOTI] disabled for Colorization IC-LoRA; using eager transformer so fused LoRA weights are active", flush=True)
|
| 302 |
# ==============================================================================================
|
| 303 |
|
| 304 |
|
|
|
|
| 326 |
# This is also the identity-safe colorization recipe recommended for this LoRA.
|
| 327 |
gen_w, gen_h = (width * 2, height * 2) if SKIP_STAGE_2 else (width, height)
|
| 328 |
|
| 329 |
+
final_prompt = build_prompt(scene_description, color_description, restoration_mode)
|
| 330 |
+
print("[PROMPT]", final_prompt, flush=True)
|
| 331 |
+
|
| 332 |
video_out, audio_out = pipeline(
|
| 333 |
+
prompt=final_prompt,
|
| 334 |
seed=seed, height=gen_h, width=gen_w,
|
| 335 |
num_frames=num_frames, frame_rate=FPS,
|
| 336 |
images=[], video_conditioning=[(ref_path, 1.0)],
|
|
|
|
| 350 |
"with the [Colorization IC-LoRA](https://huggingface.co/Lightricks/LTX-2.3-22b-IC-LoRA-Colorization)."
|
| 351 |
)
|
| 352 |
gr.Markdown(
|
| 353 |
+
"⚙️ **AOTI is disabled by default for this Colorization version** so the fused IC-LoRA weights are not bypassed. Set `USE_AOTI=1` only after testing. \n"
|
| 354 |
"Note: the Colorization LoRA is not a true deblur/denoise/decompression/upscaling model. The old-film and high-detail options below are prompt hints only; "
|
| 355 |
"for heavy restoration, use a dedicated deblur/decompression pass before or after colorization."
|
| 356 |
)
|