kritnatee's picture
download
raw
1.31 kB
#!/bin/bash
# Hugging Face Job Script — Cloud GPU Video Generation
# Usage: hf jobs run --flavor t4-small --image python:3.12 bash scripts/run-cloud-job.sh
set -e
echo "=== HF Cloud Video Job ==="
echo "Hardware: $(nvidia-smi --query-gpu=name --format=csv,noheader 2>/dev/null || echo 'CPU')"
echo ""
# Install dependencies
pip install -q diffusers transformers torch accelerate safetensors
# Download LTX-2.3 model from HF cache
HF_HOME=/root/.cache/huggingface
mkdir -p $HF_HOME
# Sync input assets from bucket
hf sync hf://buckets/kritnatee/Creator360.Studio-storage/images ./input-images
hf sync hf://buckets/kritnatee/Creator360.Studio-storage/audio ./input-audio
# Run LTX-2.3 inference
python -c "
from diffusers import LTXPipeline
import torch
pipe = LTXPipeline.from_pretrained(
'Lightricks/LTX-2.3',
torch_dtype=torch.bfloat16
).to('cuda')
# Generate
video = pipe(
prompt='Your video prompt here',
negative_prompt='',
num_frames=49,
width=512,
height=512,
num_inference_steps=20,
).frames[0]
# Save
import imageio
imageio.mimwrite('output.mp4', video, fps=24, codec='libx264')
print('Video generated: output.mp4')
"
# Sync results back to bucket
hf sync ./output.mp4 hf://buckets/kritnatee/Creator360.Studio-storage/video/
echo "=== Job Complete ==="

Xet Storage Details

Size:
1.31 kB
·
Xet hash:
f67ea0c1b24a0aa204178baac3e2c097999af557a7b6f74f634a8ef45618eef1

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.