zhiweili commited on
Commit
d8653bf
1 Parent(s): 23086f0

test mask with Juggernaut-XL-v9

Browse files
app_masked.py CHANGED
@@ -24,7 +24,7 @@ DEFAULT_CATEGORY = "hair"
24
  basepipeline = DiffusionPipeline.from_pretrained(
25
  BASE_MODEL,
26
  torch_dtype=torch.float16,
27
- use_safetensors=True,
28
  custom_pipeline="./pipelines/masked_stable_diffusion_xl_img2img.py",
29
  )
30
 
 
24
  basepipeline = DiffusionPipeline.from_pretrained(
25
  BASE_MODEL,
26
  torch_dtype=torch.float16,
27
+ # use_safetensors=True,
28
  custom_pipeline="./pipelines/masked_stable_diffusion_xl_img2img.py",
29
  )
30
 
pipelines/masked_stable_diffusion_xl_img2img.py CHANGED
@@ -212,9 +212,9 @@ class MaskedStableDiffusionXLImg2ImgPipeline(StableDiffusionXLImg2ImgPipeline):
212
  pil_mask = mask
213
  if pil_mask.mode != "L":
214
  pil_mask = pil_mask.convert("L")
215
- mask_blur = self.blur_mask(pil_mask, blur)
216
- mask_compose = self.blur_mask(pil_mask, blur_compose)
217
- mask_compose = (mask_blur + mask_compose) / 2
218
 
219
  if original_image is None:
220
  original_image = image
 
212
  pil_mask = mask
213
  if pil_mask.mode != "L":
214
  pil_mask = pil_mask.convert("L")
215
+ # mask_blur = self.blur_mask(pil_mask, blur)
216
+ # mask_compose = self.blur_mask(pil_mask, blur_compose)
217
+ mask_compose = self.blur_mask(pil_mask, blur)
218
 
219
  if original_image is None:
220
  original_image = image