-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinference.sh
More file actions
executable file
·65 lines (55 loc) · 1.76 KB
/
inference.sh
File metadata and controls
executable file
·65 lines (55 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
#================================================================
# UltraGen - Quick Inference Script
# Generate high-quality 1080P videos from text prompts
#
# For 4K generation: Use T3-Video (10x+ faster)
# https://github.com/zhangzjn/T3-Video
#================================================================
set -e
# Get script directory
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPT_DIR"
# Initialize conda environment
# Check arguments
if [ $# -eq 0 ]; then
echo "Usage: $0 <prompt> [checkpoint]"
echo ""
echo "Examples:"
echo " $0 \"A dog running in a park\""
echo " $0 \"A beautiful sunset\" checkpoints/custom_model.ckpt"
echo ""
echo "Note: This generates 1080P videos (1920x1088, 81 frames)"
echo "For 4K generation: Use T3-Video (https://github.com/zhangzjn/T3-Video)"
echo ""
exit 1
fi
# Get prompt and optional checkpoint
PROMPT="$1"
CHECKPOINT="${2:-checkpoints/ultragen_1080p.ckpt}"
MODEL_DIR="checkpoints/Wan2.1-T2V-1.3B"
OUTPUT_DIR="outputs"
# Display configuration
echo "========================================"
echo " UltraGen Video Generation"
echo "========================================"
echo "Prompt: $PROMPT"
echo "Checkpoint: $CHECKPOINT"
echo "Output: $OUTPUT_DIR"
echo "========================================"
echo ""
# Add project to PYTHONPATH
export PYTHONPATH="$SCRIPT_DIR:$PYTHONPATH"
# Create output directory
mkdir -p "$OUTPUT_DIR"
# Run inference
python3 tools/inference/generate.py \
--model_dir "$MODEL_DIR" \
--checkpoint "$CHECKPOINT" \
--prompt "$PROMPT" \
--output_dir "$OUTPUT_DIR"
echo ""
echo "========================================"
echo "✓ Generation complete!"
echo "Video saved to: $OUTPUT_DIR/"
echo "========================================"