Spaces:
Running
on
Zero
Running
on
Zero
amazonaws-la
commited on
Commit
•
d15efa4
1
Parent(s):
8ac809c
Update app.py
Browse files
app.py
CHANGED
@@ -58,6 +58,7 @@ def generate(
|
|
58 |
vaecall = 'stabilityai/sd-vae-ft-mse',
|
59 |
lora = 'amazonaws-la/juliette',
|
60 |
lora_scale: float = 0.7,
|
|
|
61 |
) -> PIL.Image.Image:
|
62 |
if torch.cuda.is_available():
|
63 |
|
@@ -71,8 +72,6 @@ def generate(
|
|
71 |
if use_lora:
|
72 |
pipe.load_lora_weights(lora)
|
73 |
pipe.fuse_lora(lora_scale=0.7)
|
74 |
-
|
75 |
-
url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
|
76 |
|
77 |
response = requests.get(url)
|
78 |
init_image = Image.open(BytesIO(response.content)).convert("RGB")
|
@@ -107,7 +106,7 @@ def generate(
|
|
107 |
guidance_scale=guidance_scale_base,
|
108 |
num_inference_steps=num_inference_steps_base,
|
109 |
generator=generator,
|
110 |
-
image=init_image
|
111 |
output_type="pil",
|
112 |
).images[0]
|
113 |
else:
|
|
|
58 |
vaecall = 'stabilityai/sd-vae-ft-mse',
|
59 |
lora = 'amazonaws-la/juliette',
|
60 |
lora_scale: float = 0.7,
|
61 |
+
url = 'https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg',
|
62 |
) -> PIL.Image.Image:
|
63 |
if torch.cuda.is_available():
|
64 |
|
|
|
72 |
if use_lora:
|
73 |
pipe.load_lora_weights(lora)
|
74 |
pipe.fuse_lora(lora_scale=0.7)
|
|
|
|
|
75 |
|
76 |
response = requests.get(url)
|
77 |
init_image = Image.open(BytesIO(response.content)).convert("RGB")
|
|
|
106 |
guidance_scale=guidance_scale_base,
|
107 |
num_inference_steps=num_inference_steps_base,
|
108 |
generator=generator,
|
109 |
+
image=init_image,
|
110 |
output_type="pil",
|
111 |
).images[0]
|
112 |
else:
|