Spaces:
Runtime error
Runtime error
trying to fix 3d model issue
Browse files
app.py
CHANGED
@@ -25,8 +25,6 @@ from src.utils.infer_util import (remove_background, resize_foreground)
|
|
25 |
from src.utils.mesh_util import save_glb, save_obj
|
26 |
from src.utils.train_util import instantiate_from_config
|
27 |
|
28 |
-
torch.backends.cuda.matmul.allow_tf32 = True
|
29 |
-
|
30 |
|
31 |
def find_cuda():
|
32 |
cuda_home = os.environ.get('CUDA_HOME') or os.environ.get('CUDA_PATH')
|
@@ -186,19 +184,6 @@ model.load_state_dict(state_dict, strict=True)
|
|
186 |
|
187 |
model = model.to(device)
|
188 |
|
189 |
-
# Load text-to-image model
|
190 |
-
print('Loading text-to-image model ...')
|
191 |
-
|
192 |
-
pipe = StableDiffusionXLPipeline.from_pretrained(
|
193 |
-
"stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.bfloat16)
|
194 |
-
pipe.to(device="cuda", dtype=torch.bfloat16)
|
195 |
-
|
196 |
-
unet_state = load_file(hf_hub_download(
|
197 |
-
"ByteDance/Hyper-SD", "Hyper-SDXL-1step-Unet.safetensors"), device="cuda")
|
198 |
-
pipe.unet.load_state_dict(unet_state)
|
199 |
-
pipe.scheduler = LCMScheduler.from_config(
|
200 |
-
pipe.scheduler.config, timestep_spacing="trailing")
|
201 |
-
|
202 |
print('Loading Finished!')
|
203 |
|
204 |
# Gradio UI
|
|
|
25 |
from src.utils.mesh_util import save_glb, save_obj
|
26 |
from src.utils.train_util import instantiate_from_config
|
27 |
|
|
|
|
|
28 |
|
29 |
def find_cuda():
|
30 |
cuda_home = os.environ.get('CUDA_HOME') or os.environ.get('CUDA_PATH')
|
|
|
184 |
|
185 |
model = model.to(device)
|
186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
print('Loading Finished!')
|
188 |
|
189 |
# Gradio UI
|