Spaces:
Runtime error
Runtime error
Suchinthana
commited on
Commit
Β·
72a8584
1
Parent(s):
4363790
adding new pipeline
Browse files
app.py
CHANGED
|
@@ -8,6 +8,7 @@ from openai import OpenAI
|
|
| 8 |
from geopy.geocoders import Nominatim
|
| 9 |
from staticmap import StaticMap, CircleMarker, Polygon
|
| 10 |
from diffusers import ControlNetModel, StableDiffusionControlNetInpaintPipeline
|
|
|
|
| 11 |
import spaces
|
| 12 |
import logging
|
| 13 |
import math
|
|
@@ -204,11 +205,17 @@ def generate_static_map(geojson_data, invisible=False):
|
|
| 204 |
return m.render()
|
| 205 |
|
| 206 |
# ControlNet pipeline setup
|
| 207 |
-
controlnet = ControlNetModel.from_pretrained("stabilityai/stable-diffusion-2-inpainting", torch_dtype=torch.float16)
|
| 208 |
-
pipeline = StableDiffusionControlNetInpaintPipeline.from_pretrained(
|
| 209 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
)
|
| 211 |
-
pipeline.to(
|
| 212 |
|
| 213 |
@spaces.GPU
|
| 214 |
def make_inpaint_condition(init_image, mask_image):
|
|
|
|
| 8 |
from geopy.geocoders import Nominatim
|
| 9 |
from staticmap import StaticMap, CircleMarker, Polygon
|
| 10 |
from diffusers import ControlNetModel, StableDiffusionControlNetInpaintPipeline
|
| 11 |
+
from diffusers import StableDiffusionInpaintPipeline
|
| 12 |
import spaces
|
| 13 |
import logging
|
| 14 |
import math
|
|
|
|
| 205 |
return m.render()
|
| 206 |
|
| 207 |
# ControlNet pipeline setup
|
| 208 |
+
# controlnet = ControlNetModel.from_pretrained("stabilityai/stable-diffusion-2-inpainting", torch_dtype=torch.float16)
|
| 209 |
+
# pipeline = StableDiffusionControlNetInpaintPipeline.from_pretrained(
|
| 210 |
+
# "stable-diffusion-v1-5/stable-diffusion-inpainting", controlnet=controlnet, torch_dtype=torch.float16
|
| 211 |
+
# )
|
| 212 |
+
# pipeline.to('cuda')
|
| 213 |
+
|
| 214 |
+
pipeline = StableDiffusionInpaintPipeline.from_pretrained(
|
| 215 |
+
"stabilityai/stable-diffusion-2-inpainting",
|
| 216 |
+
torch_dtype=torch.float16,
|
| 217 |
)
|
| 218 |
+
pipeline.to("cuda")
|
| 219 |
|
| 220 |
@spaces.GPU
|
| 221 |
def make_inpaint_condition(init_image, mask_image):
|