Update gradio_app.py
Browse files- gradio_app.py +3 -2
gradio_app.py
CHANGED
|
@@ -89,6 +89,7 @@ def chmod(path, mode):
|
|
| 89 |
|
| 90 |
chmod(f"{parent_dir}/apps/third_party/InstantMeshes", "777")
|
| 91 |
|
|
|
|
| 92 |
model = None
|
| 93 |
cached_dir = None
|
| 94 |
generator = None
|
|
@@ -108,7 +109,8 @@ def gen_mvimg(
|
|
| 108 |
):
|
| 109 |
if seed == 0:
|
| 110 |
seed = np.random.randint(1, 65535)
|
| 111 |
-
global
|
|
|
|
| 112 |
generator.manual_seed(seed)
|
| 113 |
|
| 114 |
if mvimg_model == "CRM":
|
|
@@ -277,7 +279,6 @@ if __name__=="__main__":
|
|
| 277 |
trust_remote_code=True,
|
| 278 |
)
|
| 279 |
|
| 280 |
-
generator = torch.Generator(device)
|
| 281 |
|
| 282 |
# for 3D latent set diffusion
|
| 283 |
ckpt_path = hf_hub_download(repo_id="wyysf/CraftsMan", filename="image-to-shape-diffusion/clip-mvrgb-modln-l256-e64-ne8-nd16-nl6-aligned-vae/model.ckpt", repo_type="model")
|
|
|
|
| 89 |
|
| 90 |
chmod(f"{parent_dir}/apps/third_party/InstantMeshes", "777")
|
| 91 |
|
| 92 |
+
device = None
|
| 93 |
model = None
|
| 94 |
cached_dir = None
|
| 95 |
generator = None
|
|
|
|
| 109 |
):
|
| 110 |
if seed == 0:
|
| 111 |
seed = np.random.randint(1, 65535)
|
| 112 |
+
global generatorm device
|
| 113 |
+
generator = torch.Generator(device)
|
| 114 |
generator.manual_seed(seed)
|
| 115 |
|
| 116 |
if mvimg_model == "CRM":
|
|
|
|
| 279 |
trust_remote_code=True,
|
| 280 |
)
|
| 281 |
|
|
|
|
| 282 |
|
| 283 |
# for 3D latent set diffusion
|
| 284 |
ckpt_path = hf_hub_download(repo_id="wyysf/CraftsMan", filename="image-to-shape-diffusion/clip-mvrgb-modln-l256-e64-ne8-nd16-nl6-aligned-vae/model.ckpt", repo_type="model")
|