Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -59,10 +59,13 @@ def generate(
|
|
59 |
|
60 |
if not use_vae:
|
61 |
pipe = StableDiffusionImg2ImgPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16)
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
|
|
|
|
66 |
|
67 |
if use_vae:
|
68 |
vae = AutoencoderKL.from_pretrained(vaecall, torch_dtype=torch.float16)
|
|
|
59 |
|
60 |
if not use_vae:
|
61 |
pipe = StableDiffusionImg2ImgPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16)
|
62 |
+
img = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
|
63 |
+
def resize(value,img):
|
64 |
+
img = Image.open(img)
|
65 |
+
img = img.resize((value,value))
|
66 |
+
return img
|
67 |
+
source_image = resize(768, source_img)
|
68 |
+
source_image.save('source.png')
|
69 |
|
70 |
if use_vae:
|
71 |
vae = AutoencoderKL.from_pretrained(vaecall, torch_dtype=torch.float16)
|