Complete imports
Browse files
app.py
CHANGED
|
@@ -4,15 +4,29 @@ import os
|
|
| 4 |
|
| 5 |
os.environ['HF_HOME'] = os.path.abspath(os.path.realpath(os.path.join(os.path.dirname(__file__), './hf_download')))
|
| 6 |
|
|
|
|
| 7 |
import gradio as gr
|
| 8 |
import torch
|
| 9 |
import traceback
|
| 10 |
import einops
|
| 11 |
import safetensors.torch as sf
|
| 12 |
import numpy as np
|
| 13 |
-
import
|
| 14 |
import random
|
| 15 |
-
import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
from PIL import Image
|
| 18 |
from diffusers import AutoencoderKLHunyuanVideo
|
|
@@ -27,6 +41,7 @@ from diffusers_helper.gradio.progress_bar import make_progress_bar_css, make_pro
|
|
| 27 |
from transformers import SiglipImageProcessor, SiglipVisionModel
|
| 28 |
from diffusers_helper.clip_vision import hf_clip_vision_encode
|
| 29 |
from diffusers_helper.bucket_tools import find_nearest_bucket
|
|
|
|
| 30 |
|
| 31 |
|
| 32 |
if torch.cuda.device_count() > 0:
|
|
|
|
| 4 |
|
| 5 |
os.environ['HF_HOME'] = os.path.abspath(os.path.realpath(os.path.join(os.path.dirname(__file__), './hf_download')))
|
| 6 |
|
| 7 |
+
import spaces
|
| 8 |
import gradio as gr
|
| 9 |
import torch
|
| 10 |
import traceback
|
| 11 |
import einops
|
| 12 |
import safetensors.torch as sf
|
| 13 |
import numpy as np
|
| 14 |
+
import argparse
|
| 15 |
import random
|
| 16 |
+
import math
|
| 17 |
+
# 20250506 pftq: Added for video input loading
|
| 18 |
+
import decord
|
| 19 |
+
# 20250506 pftq: Added for progress bars in video_encode
|
| 20 |
+
from tqdm import tqdm
|
| 21 |
+
# 20250506 pftq: Normalize file paths for Windows compatibility
|
| 22 |
+
import pathlib
|
| 23 |
+
# 20250506 pftq: for easier to read timestamp
|
| 24 |
+
from datetime import datetime
|
| 25 |
+
# 20250508 pftq: for saving prompt to mp4 comments metadata
|
| 26 |
+
import imageio_ffmpeg
|
| 27 |
+
import tempfile
|
| 28 |
+
import shutil
|
| 29 |
+
import subprocess
|
| 30 |
|
| 31 |
from PIL import Image
|
| 32 |
from diffusers import AutoencoderKLHunyuanVideo
|
|
|
|
| 41 |
from transformers import SiglipImageProcessor, SiglipVisionModel
|
| 42 |
from diffusers_helper.clip_vision import hf_clip_vision_encode
|
| 43 |
from diffusers_helper.bucket_tools import find_nearest_bucket
|
| 44 |
+
from diffusers import BitsAndBytesConfig as DiffusersBitsAndBytesConfig, HunyuanVideoTransformer3DModel, HunyuanVideoPipeline
|
| 45 |
|
| 46 |
|
| 47 |
if torch.cuda.device_count() > 0:
|