Skip to content

Commit

Permalink
added low-res-fix using tile-- let's see if it fixes or not
Browse files Browse the repository at this point in the history
  • Loading branch information
usamaehsan committed Nov 19, 2023
1 parent cd6fb97 commit 647a3e3
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,15 @@ def predict(
low_res_fix_steps: int = Input(
description="controlnet tile resolution- after image generation", default=10
),
low_res_fix_prompt: str = Input(
description="", default="best quality"
),
low_res_fix_negative_prompt: str = Input(
description="", default="blur, lowres, bad anatomy, bad hands, cropped, worst quality"
),
low_res_fix_guess_mode: bool = Input(
description="low res fix - guess mode", default=False
),
) -> List[Path]:
if len(MISSING_WEIGHTS) > 0:
raise Exception("missing weights")
Expand Down Expand Up @@ -496,19 +505,17 @@ def predict(
condition_image = self.resize_for_condition_image(output.images[0], low_res_fix_resolution)
print("condition image resize took", time.time() - start, "seconds")
tile_output= self.tile_pipe(
# prompt="",
# negative_prompt="",
prompt_embeds=self.compel_proc(prompt),
negative_prompt_embeds=self.compel_proc(negative_prompt),
prompt_embeds=self.compel_proc(low_res_fix_prompt),
negative_prompt_embeds=self.compel_proc(low_res_fix_negative_prompt),
image= condition_image,
num_inference_steps= low_res_fix_steps,
width=condition_image.size[0],
height=condition_image.size[1],
controlnet_conditioning_scale=2.0,
generator=generator,
# guess_mode= True,
guess_mode= low_res_fix_guess_mode,
)

path = f"/tmp/low-res-{seed_}.png"
print("low-res-fix took", time.time() - start, "seconds")
tile_output.images[0].save(path)
Expand Down

0 comments on commit 647a3e3

Please sign in to comment.