Skip to content

Commit

Permalink
remove unexpected masks
Browse files Browse the repository at this point in the history
  • Loading branch information
ototadana committed Dec 2, 2023
1 parent 30a4cf3 commit 19bee20
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion scripts/inferencers/img2img_face_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,16 @@ def process(
has_hr_checkpoint_name = hasattr(p, "enable_hr") and p.enable_hr and hasattr(p, "hr_checkpoint_name") and p.hr_checkpoint_name is not None and hasattr(p, "override_settings")
if has_hr_checkpoint_name:
backup_sd_model_checkpoint = p.override_settings.get("sd_model_checkpoint", None)
p.override_settings["sd_model_checkpoint"] = p.hr_checkpoint_name
p.override_settings["sd_model_checkpoint"] = p.hr_checkpoint_name
if getattr(p, "overlay_images", []):
overlay_images = p.overlay_images
p.overlay_images = []
if hasattr(p, "image_mask"):
image_mask = p.image_mask
p.image_mask = None
if hasattr(p, "mask"):
mask = p.mask
p.mask = None

print(f"prompt for the {face.face_area.tag}: {p.prompt}")

Expand All @@ -48,5 +57,11 @@ def process(
p.refiner_switch_at = refiner_switch_at
if has_hr_checkpoint_name:
p.override_settings["sd_model_checkpoint"] = backup_sd_model_checkpoint
if getattr(p, "overlay_images", []):
p.overlay_images = overlay_images
if hasattr(p, "image_mask"):
p.image_mask = image_mask
if hasattr(p, "mask"):
p.mask = mask

return proc.images[0]

0 comments on commit 19bee20

Please sign in to comment.