Upload app.py
Browse files
app.py
CHANGED
|
@@ -60,15 +60,12 @@ print("SD Inpainting ready.")
|
|
| 60 |
|
| 61 |
# COLORING- IMG2IMG Pipeline
|
| 62 |
colour= StableDiffusionImg2ImgPipeline(
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
feature_extractor= None,
|
| 70 |
-
requires_safety_checker= False,
|
| 71 |
-
).to("cuda")
|
| 72 |
|
| 73 |
|
| 74 |
# BLIP
|
|
@@ -223,6 +220,7 @@ def enhance_image(image, scale_factor):
|
|
| 223 |
|
| 224 |
@spaces.GPU
|
| 225 |
def colour_image(image, prompt, strength):
|
|
|
|
| 226 |
if Image is None:
|
| 227 |
raise gr.Error("Please Upload the Image")
|
| 228 |
# Convert to RGB
|
|
|
|
| 60 |
|
| 61 |
# COLORING- IMG2IMG Pipeline
|
| 62 |
colour= StableDiffusionImg2ImgPipeline(
|
| 63 |
+
"runwayml/stable-diffusion-v1-5",
|
| 64 |
+
torch_dtype=torch.float16,
|
| 65 |
+
safety_checker=None,
|
| 66 |
+
requires_safety_checker=False,
|
| 67 |
+
)
|
| 68 |
+
print("colour model ready!")
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
|
| 71 |
# BLIP
|
|
|
|
| 220 |
|
| 221 |
@spaces.GPU
|
| 222 |
def colour_image(image, prompt, strength):
|
| 223 |
+
colour.to("cuda")
|
| 224 |
if Image is None:
|
| 225 |
raise gr.Error("Please Upload the Image")
|
| 226 |
# Convert to RGB
|