Deploy NFA Track R FLUX.2 Fun CN ZeroGPU (real depth CN)
Browse files
app.py
CHANGED
|
@@ -30,28 +30,39 @@ _VX_CACHE = Path.home() / "VideoX-Fun"
|
|
| 30 |
|
| 31 |
def _patch_videox_models_init(root: Path) -> None:
|
| 32 |
models_init = root / "videox_fun" / "models" / "__init__.py"
|
| 33 |
-
if
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
|
| 57 |
def _ensure_videox_on_path() -> None:
|
|
|
|
| 30 |
|
| 31 |
def _patch_videox_models_init(root: Path) -> None:
|
| 32 |
models_init = root / "videox_fun" / "models" / "__init__.py"
|
| 33 |
+
if models_init.is_file():
|
| 34 |
+
text = models_init.read_text(encoding="utf-8", errors="replace")
|
| 35 |
+
if not (
|
| 36 |
+
"Flux2ControlTransformer2DModel" in text and "fantasytalking" not in text
|
| 37 |
+
):
|
| 38 |
+
models_init.write_text(
|
| 39 |
+
"from transformers import Mistral3ForConditionalGeneration, PixtralProcessor\n"
|
| 40 |
+
"from .flux2_image_processor import Flux2ImageProcessor\n"
|
| 41 |
+
"from .flux2_transformer2d import Flux2Transformer2DModel\n"
|
| 42 |
+
"from .flux2_transformer2d_control import Flux2ControlTransformer2DModel\n"
|
| 43 |
+
"from .flux2_vae import AutoencoderKLFlux2\n"
|
| 44 |
+
"__all__ = [\n"
|
| 45 |
+
" 'AutoencoderKLFlux2',\n"
|
| 46 |
+
" 'Flux2ControlTransformer2DModel',\n"
|
| 47 |
+
" 'Flux2ImageProcessor',\n"
|
| 48 |
+
" 'Flux2Transformer2DModel',\n"
|
| 49 |
+
" 'Mistral3ForConditionalGeneration',\n"
|
| 50 |
+
" 'PixtralProcessor',\n"
|
| 51 |
+
"]\n",
|
| 52 |
+
encoding="utf-8",
|
| 53 |
+
)
|
| 54 |
+
print("[nfa-fun-cn] patched videox_fun.models.__init__ (Flux2-only)", flush=True)
|
| 55 |
+
|
| 56 |
+
pipe_init = root / "videox_fun" / "pipeline" / "__init__.py"
|
| 57 |
+
if pipe_init.is_file():
|
| 58 |
+
text = pipe_init.read_text(encoding="utf-8", errors="replace")
|
| 59 |
+
if "pipeline_cogvideox" in text or "Flux2ControlPipeline" not in text:
|
| 60 |
+
pipe_init.write_text(
|
| 61 |
+
"from .pipeline_flux2_control import Flux2ControlPipeline\n"
|
| 62 |
+
"__all__ = ['Flux2ControlPipeline']\n",
|
| 63 |
+
encoding="utf-8",
|
| 64 |
+
)
|
| 65 |
+
print("[nfa-fun-cn] patched videox_fun.pipeline.__init__ (Flux2-only)", flush=True)
|
| 66 |
|
| 67 |
|
| 68 |
def _ensure_videox_on_path() -> None:
|