Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LTX-2.3 Free GPU Deployment — Colab & Kaggle

License: MIT Python 3.11+ Platform: Colab + Kaggle

Deploy LTX-2.3 text-to-video (uncensored PinkCherry v1.8 fine-tune) on free GPU tiers — Google Colab T4 or Kaggle (P100/T4) — with post-decode RealESRGAN 4× upscaling, a public tunnel URL, and auto-upload of finished MP4s to Google Drive.

Prompt ──► gateway (HTTP API / Gradio) ──► ComfyUI (--lowvram --cache-none) ──► MP4
                                                    │
                                    RealESRGAN x4 post-decode (576x320→1152x640, 512x288→2048x1152)
                                                    │
                            local watcher ──► Google Drive (signed-in browser)

Model stack

Role File Size
Unet (uncensored) PinkCherry_FineTune_Q5_K_M_v18_LTX23.gguf · SexGod1979/PinkCherry_NSFW_LTX23 15.2 GB
LoRA @ 0.6 ltx-2.3-22b-distilled-lora-384-1.1.safetensors · Lightricks/LTX-2.3 7.3 GB
Text encoder gemma-3-12b-it-heretic-v2-Q3_K_M.gguf (DreamFast) — Q3 GGUF is mandatory, fp8 OOMs 5.7 GB
Projection ltx-2.3_text_projection_bf16.safetensors · Kijai/LTX2.3_comfy 2.3 GB
Video VAE LTX23_video_vae_bf16.safetensors 1.45 GB
Audio VAE LTX23_audio_vae_bf16.safetensors 0.36 GB
Upscaler RealESRGAN_x4plus.pth (post-decode) 64 MB

Quality improvements (all included in gateway/ltx_gateway.py)

  • RealESRGAN x4 post-decode upscale — runs after sampling when unet VRAM is freed; 576×320 → 1152×640 (Colab), 512×288 → 2048×1152 (Kaggle P100)
  • last_frame_fix: True on LTXVTiledVAEDecode — kills tile-seam flicker
  • crf: 16 on the h264 encoder (cleaner than default 18/23)
  • LTXVChunkFeedForward (chunks=2, dim_threshold=4096) — ~2× activation memory cut (PinkCherry v1.8 recipe)
  • --lowvram --cache-none ComfyUI flags + --comfy-watchdog auto-relaunch
  • --clips N multi-clip concat for longer videos (frames OOM, concat is free)

Platform comparison (measured)

Google Colab (T4) Kaggle (P100-16GB)
Usable VRAM ~15.4 GB ~13-14 GB
Working resolution 576×320×49 (+audio OK) 512×288×33 (audio OOMs)
Upscaled output 1152×640 2048×1152
Render time (~8 steps) ~7 min ~11 min
RAM 12 GB cgroup 20 GB+
Session / quota ~2 h, ~4 GPU sessions/day ~9 h, 30 h/week

Which to use: Colab for highest quality + audio; Kaggle for long-running / scheduled work. Same gateway code, same CLI, same Drive pipeline.

Deploy on Google Colab (free T4)

See AGENTS.md §Colab and deploy/ scripts. Requires google-colab-cli (OAuth'd) + a headed Chrome over CDP on 127.0.0.1:9223 for Drive uploads.

colabctl run --gpu T4 --keep -s ltx23 --timeout 1500 deploy/create_vm.py
colabctl exec -s ltx23 -f deploy/setup1.py --timeout 1200
colabctl exec -s ltx23 -f deploy/setup2b.py --timeout 3000   # 40GB models
colabctl exec -s ltx23 -f deploy/setup3.py --timeout 150     # gateway + URL
colabctl exec -s ltx23 -f tests/smoketest.py --timeout 1800  # SMOKE_OK

Gateway: gateway/ltx_gateway.py (Gradio UI + --api mode), CLI: gateway/ltx_cli.py, Drive: drive/drive_push.py.

Deploy on Kaggle (free, script kernel)

See AGENTS.md §Kaggle and the kaggle/ directory. One push, ~8 min setup (33 GB models on Kaggle's fast pipe), tunnel URL printed in the kernel log.

cd kaggle
# 1) edit kernel-metadata.json -> YOUR_KAGGLE_USERNAME/ltx23-kaggle-deploy
# 2) embed the gateway into main.py (Kaggle only uploads the code_file)
python3 build_kernel.py && cp main_built.py main.py
# 3) push (requires ~/.kaggle/credentials.json OAuth'd, `kaggle` CLI)
kaggle kernels push -p .
# 4) stream the log; prints: PUBLIC URL: https://<hash>.trycloudflare.com
python3 kaggle_log_watch.py --no-reconnect --timeout 1800

Generate from your machine:

python3 ltx_kaggle_cli.py --url https://<tunnel>.trycloudflare.com \
    --once "a cyberpunk street in rain, neon reflections, slow dolly in" \
    -r 512x288 -f 33 -s 42 --upscale
python3 ltx_kaggle_cli.py --url https://<tunnel>.trycloudflare.com \
    --once "prompt" --clips 3 --upscale        # ~4 s video
python3 kaggle_drive_watch.py                  # auto-upload to Drive

Kaggle gotchas (hard-won)

  • Free GPU is a Tesla P100 (sm_60) — torch ≥ 2.7 wheels (cu126/cu128) have no sm_60 kernels (CUDA error: no kernel image). The kernel installs torch 2.6.0+cu124 (last line with sm_60+sm_75 support) with --extra-index-url https://pypi.org/simple (else nvidia-cudnn deps unresolvable).
  • ComfyUI HEAD requires torch ≥ 2.7 (comfy_kitchen). Pinned to 43c64b6308f9 (2026-03-05, "Support the LTXAV 2.3 model") — has the fixed text-projection loading and wraps comfy_kitchen in try/except. comfy-kitchen==0.2.7 pinned for torch 2.6.
  • Kaggle's SSE log endpoint replays the whole log on connect and drops during silent periods — use --no-reconnect and connect after setup (~8 min). Rate-limits (429) if you hammer reconnects.
  • Drive upload: click button[aria-label='New']:visible, then the span text=File upload (not div[role=menuitem]), then set_input_files on the input it creates.

API (what the tunnel exposes)

Route Method Purpose
/ /status GET stage, comfy alive, jobs, uptime
/gen POST {prompt, width, height, frames, fps, seed, steps, audio, upscale}{job}
/job/<id> GET {status, name, size, seconds}
/out/<name> GET download the mp4

Repository layout

AGENTS.md                      # AI-agent deployment runbook (Colab + Kaggle)
gateway/ltx_gateway.py         # shared gateway (Gradio + --api + upscale + watchdog)
gateway/ltx_cli.py             # Colab CLI (--clips N concat)
deploy/                        # Colab provisioning scripts (setup1/2b/3, create_vm...)
drive/                         # Drive upload watcher + primitive (CDP browser)
monitor/                       # gw_health, keepalive (Colab)
tests/                         # smoke tests, OOM checks, probes
references/                    # deployment notes + render-loop lessons
kaggle/                        # Kaggle script-kernel deployment
  main.py                      #   kernel template (gateway embedded at build time)
  build_kernel.py              #   base64-embeds ../gateway/ltx_gateway.py into main.py
  kernel-metadata.json         #   private kernel, GPU+internet on
  ltx_kaggle_cli.py            #   local REST client for the tunnel
  kaggle_log_watch.py          #   SSE log stream -> extracts PUBLIC URL
  kaggle_drive_watch.py        #   auto-upload new videos to Drive

Topics

ltx23 ltx-2.3 text-to-video video-generation comfyui gguf colab kaggle free-gpu t4 p100 ai-video realesrgan uncensored pinkcherry image-to-video diffusion

License

MIT

About

Deploy LTX-2.3 uncensored text-to-video (PinkCherry v1.8 GGUF + RealESRGAN upscale) on free Google Colab T4 or Kaggle P100 — gateway, tunnel, CLI, Drive auto-upload

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages