Spaces:
Paused
Paused
Update app_gradio.py
Browse files- app_gradio.py +2 -2
app_gradio.py
CHANGED
@@ -67,7 +67,7 @@ def prepare_latents(pipe, x_aug):
|
|
67 |
|
68 |
@torch.no_grad()
|
69 |
def invert(pipe, inv, load_name, device="cuda", dtype=torch.bfloat16):
|
70 |
-
input_img = [load_image(load_name, 256).to(device, dtype=dtype).unsqueeze(1)]
|
71 |
input_img = torch.cat(input_img, dim=1)
|
72 |
latents = prepare_latents(pipe, input_img).to(torch.bfloat16)
|
73 |
inv.set_timesteps(25)
|
@@ -191,7 +191,7 @@ def generate_output(image, apply_filter, prompt: str, num_seeds: int = 3, lambda
|
|
191 |
temp_image_path = os.path.join(exp_dir, f"temp_input_{unique_id}.png")
|
192 |
|
193 |
image = Image.open(image)
|
194 |
-
image = image.resize((256, 256), Image.LANCZOS)
|
195 |
|
196 |
image.save(temp_image_path)
|
197 |
|
|
|
67 |
|
68 |
@torch.no_grad()
|
69 |
def invert(pipe, inv, load_name, device="cuda", dtype=torch.bfloat16):
|
70 |
+
input_img = [load_image(load_name, 256).to(device, dtype=dtype).unsqueeze(1)] * 5
|
71 |
input_img = torch.cat(input_img, dim=1)
|
72 |
latents = prepare_latents(pipe, input_img).to(torch.bfloat16)
|
73 |
inv.set_timesteps(25)
|
|
|
191 |
temp_image_path = os.path.join(exp_dir, f"temp_input_{unique_id}.png")
|
192 |
|
193 |
image = Image.open(image)
|
194 |
+
image = image.resize((256, 256), Image.Resampling.LANCZOS)
|
195 |
|
196 |
image.save(temp_image_path)
|
197 |
|