Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -59,12 +59,11 @@ 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 |
-
source_image.save('source.png')
|
68 |
|
69 |
if use_vae:
|
70 |
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 |
+
url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
|
63 |
+
|
64 |
+
response = requests.get(url)
|
65 |
+
init_image = Image.open(BytesIO(response.content)).convert("RGB")
|
66 |
+
init_image = init_image.resize((768, 512))
|
|
|
67 |
|
68 |
if use_vae:
|
69 |
vae = AutoencoderKL.from_pretrained(vaecall, torch_dtype=torch.float16)
|