Closed mjalali closed 1 year ago
Hi, would you try the exact package versions that we specified in requirements.txt?
I think it may be due to the diffusers version, because I was not able to find the line do_denormalize = [not has_nsfw for has_nsfw in has_nsfw_concept]
in pipeline_stable_diffusion.py of diffusers==0.15.0.
FYI, for the benchmark evaluation, we turned off the NSFW filter at this line (to prevent black images) and tested it with the above version.
Yeah your right. my diffusers version was the latest: 0.19.3.
I handled the problem by changing the stable_diffusion source code in this path: diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py
if not output_type == "latent":
image = self.vae.decode(latents / self.vae.config.scaling_factor, return_dict=False)[0]
image, has_nsfw_concept = self.run_safety_checker(image, device, prompt_embeds.dtype)
else:
image = latents
has_nsfw_concept = None
# if has_nsfw_concept is None:
# do_denormalize = [True] * image.shape[0]
# else:
# do_denormalize = [not has_nsfw for has_nsfw in has_nsfw_concept]
image = self.image_processor.postprocess(image, output_type=output_type, do_denormalize=[True] * image.shape[0])
Thank you for your quick response :)
Hi! I ran this line of code to generate samples to compute FID:
Then I got this error: