Spaces:
Runtime error
Runtime error
Update freesplatter/webui/runner.py
Browse files- freesplatter/webui/runner.py +12 -8
freesplatter/webui/runner.py
CHANGED
|
@@ -2,6 +2,7 @@ import os
|
|
| 2 |
import json
|
| 3 |
import uuid
|
| 4 |
import time
|
|
|
|
| 5 |
import rembg
|
| 6 |
import numpy as np
|
| 7 |
import trimesh
|
|
@@ -83,6 +84,17 @@ class FreeSplatterRunner:
|
|
| 83 |
# self.rembg = rembg.new_session('birefnet-general')
|
| 84 |
|
| 85 |
# diffusion models
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
pipeline = DiffusionPipeline.from_pretrained(
|
| 87 |
"sudo-ai/zero123plus-v1.1",
|
| 88 |
custom_pipeline="sudo-ai/zero123plus-pipeline",
|
|
@@ -103,14 +115,6 @@ class FreeSplatterRunner:
|
|
| 103 |
)
|
| 104 |
self.zero123plus_v12 = pipeline.to(device)
|
| 105 |
|
| 106 |
-
download_dir = snapshot_download('tencent/Hunyuan3D-1', repo_type='model')
|
| 107 |
-
pipeline = HunYuan3D_MVD_Std_Pipeline.from_pretrained(
|
| 108 |
-
os.path.join(download_dir, 'mvd_std'),
|
| 109 |
-
torch_dtype=torch.float16,
|
| 110 |
-
use_safetensors=True,
|
| 111 |
-
)
|
| 112 |
-
self.hunyuan3d_mvd_std = pipeline.to(device)
|
| 113 |
-
|
| 114 |
# freesplatter
|
| 115 |
config_file = 'configs/freesplatter-object.yaml'
|
| 116 |
ckpt_path = hf_hub_download('TencentARC/FreeSplatter', repo_type='model', filename='freesplatter-object.safetensors')
|
|
|
|
| 2 |
import json
|
| 3 |
import uuid
|
| 4 |
import time
|
| 5 |
+
import shutil
|
| 6 |
import rembg
|
| 7 |
import numpy as np
|
| 8 |
import trimesh
|
|
|
|
| 84 |
# self.rembg = rembg.new_session('birefnet-general')
|
| 85 |
|
| 86 |
# diffusion models
|
| 87 |
+
download_dir = snapshot_download('tencent/Hunyuan3D-1', repo_type='model')
|
| 88 |
+
shutil.rmtree(os.path.join(download_dir, 'assets'))
|
| 89 |
+
shutil.rmtree(os.path.join(download_dir, 'mvd_lite'))
|
| 90 |
+
shutil.rmtree(os.path.join(download_dir, 'svrm'))
|
| 91 |
+
pipeline = HunYuan3D_MVD_Std_Pipeline.from_pretrained(
|
| 92 |
+
os.path.join(download_dir, 'mvd_std'),
|
| 93 |
+
torch_dtype=torch.float16,
|
| 94 |
+
use_safetensors=True,
|
| 95 |
+
)
|
| 96 |
+
self.hunyuan3d_mvd_std = pipeline.to(device)
|
| 97 |
+
|
| 98 |
pipeline = DiffusionPipeline.from_pretrained(
|
| 99 |
"sudo-ai/zero123plus-v1.1",
|
| 100 |
custom_pipeline="sudo-ai/zero123plus-pipeline",
|
|
|
|
| 115 |
)
|
| 116 |
self.zero123plus_v12 = pipeline.to(device)
|
| 117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
# freesplatter
|
| 119 |
config_file = 'configs/freesplatter-object.yaml'
|
| 120 |
ckpt_path = hf_hub_download('TencentARC/FreeSplatter', repo_type='model', filename='freesplatter-object.safetensors')
|