Spaces:
Running
on
Zero
Running
on
Zero
Bobby
commited on
Commit
·
f1647cf
1
Parent(s):
4d4920b
hf hub download
Browse files
README.md
CHANGED
@@ -1,16 +1,12 @@
|
|
1 |
-
---
|
2 |
title: Interior AI Designer
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
sdk_version: 4.37.2
|
8 |
app_file: app.py
|
9 |
header: mini
|
10 |
theme: bethecloud/storj_theme
|
11 |
-
pinned:
|
12 |
license: apache-2.0
|
13 |
-
short_description: Ikea could never
|
14 |
-
---
|
15 |
-
|
16 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
1 |
title: Interior AI Designer
|
2 |
+
emoji: 🏠
|
3 |
+
colorFrom: green
|
4 |
+
colorTo: blue
|
5 |
sdk: gradio
|
6 |
sdk_version: 4.37.2
|
7 |
app_file: app.py
|
8 |
header: mini
|
9 |
theme: bethecloud/storj_theme
|
10 |
+
pinned: true
|
11 |
license: apache-2.0
|
12 |
+
short_description: Ikea could never
|
|
|
|
|
|
app.py
CHANGED
@@ -21,7 +21,7 @@ from diffusers import (
|
|
21 |
StableDiffusionControlNetPipeline,
|
22 |
# AutoencoderKL,
|
23 |
)
|
24 |
-
from huggingface_hub import
|
25 |
from controlnet_aux_local import NormalBaeDetector
|
26 |
|
27 |
MAX_SEED = np.iinfo(np.int32).max
|
@@ -56,7 +56,7 @@ class Preprocessor:
|
|
56 |
return
|
57 |
elif name == "NormalBae":
|
58 |
print("Loading NormalBae")
|
59 |
-
model_file =
|
60 |
self.model = NormalBaeDetector.from_pretrained(model_file).to("cuda")
|
61 |
torch.cuda.empty_cache()
|
62 |
self.name = name
|
@@ -81,7 +81,7 @@ torch.cuda.max_memory_allocated(device="cuda")
|
|
81 |
# Controlnet Normal
|
82 |
model_id = "lllyasviel/control_v11p_sd15_normalbae"
|
83 |
print("initializing controlnet")
|
84 |
-
controlnet_file =
|
85 |
controlnet = ControlNetModel.from_pretrained(
|
86 |
controlnet_file,
|
87 |
torch_dtype=torch.float16,
|
@@ -105,7 +105,7 @@ controlnet = ControlNetModel.from_pretrained(
|
|
105 |
|
106 |
# Scheduler
|
107 |
scheduler_repo = "runwayml/stable-diffusion-v1-5"
|
108 |
-
scheduler_file =
|
109 |
scheduler = DPMSolverMultistepScheduler.from_pretrained(
|
110 |
scheduler_file,
|
111 |
solver_order=2,
|
@@ -142,7 +142,7 @@ vae_url = "https://huggingface.co/stabilityai/sd-vae-ft-mse-original/blob/main/v
|
|
142 |
|
143 |
# Stable Diffusion Pipeline
|
144 |
base_model_repo = "Lykon/AbsoluteReality"
|
145 |
-
base_model_file =
|
146 |
|
147 |
print('loading pipe')
|
148 |
pipe = StableDiffusionControlNetPipeline.from_single_file(
|
|
|
21 |
StableDiffusionControlNetPipeline,
|
22 |
# AutoencoderKL,
|
23 |
)
|
24 |
+
from huggingface_hub import hf_hub_download, hf_hub_url
|
25 |
from controlnet_aux_local import NormalBaeDetector
|
26 |
|
27 |
MAX_SEED = np.iinfo(np.int32).max
|
|
|
56 |
return
|
57 |
elif name == "NormalBae":
|
58 |
print("Loading NormalBae")
|
59 |
+
model_file = hf_hub_download(self.MODEL_ID, filename="NormalBaeDetector.pth")
|
60 |
self.model = NormalBaeDetector.from_pretrained(model_file).to("cuda")
|
61 |
torch.cuda.empty_cache()
|
62 |
self.name = name
|
|
|
81 |
# Controlnet Normal
|
82 |
model_id = "lllyasviel/control_v11p_sd15_normalbae"
|
83 |
print("initializing controlnet")
|
84 |
+
controlnet_file = hf_hub_download(model_id, filename="diffusion_pytorch_model.safetensors")
|
85 |
controlnet = ControlNetModel.from_pretrained(
|
86 |
controlnet_file,
|
87 |
torch_dtype=torch.float16,
|
|
|
105 |
|
106 |
# Scheduler
|
107 |
scheduler_repo = "runwayml/stable-diffusion-v1-5"
|
108 |
+
scheduler_file = hf_hub_download(scheduler_repo, filename="scheduler/scheduler_config.json", subfolder="scheduler")
|
109 |
scheduler = DPMSolverMultistepScheduler.from_pretrained(
|
110 |
scheduler_file,
|
111 |
solver_order=2,
|
|
|
142 |
|
143 |
# Stable Diffusion Pipeline
|
144 |
base_model_repo = "Lykon/AbsoluteReality"
|
145 |
+
base_model_file = hf_hub_download(base_model_repo, filename="AbsoluteReality_1.8.1_pruned.safetensors")
|
146 |
|
147 |
print('loading pipe')
|
148 |
pipe = StableDiffusionControlNetPipeline.from_single_file(
|