diff --git a/examples/community/README.md b/examples/community/README.md index dc35d36a953d..4985ca53e95d 100644 --- a/examples/community/README.md +++ b/examples/community/README.md @@ -399,6 +399,7 @@ import requests from PIL import Image from io import BytesIO import torch +import os from diffusers import DiffusionPipeline, DDIMScheduler has_cuda = torch.cuda.is_available() device = torch.device('cpu' if not has_cuda else 'cuda') @@ -423,6 +424,7 @@ res = pipe.train( num_inference_steps=50, generator=generator) res = pipe(alpha=1) +os.makedirs("imagic", exist_ok=True) image = res.images[0] image.save('./imagic/imagic_image_alpha_1.png') res = pipe(alpha=1.5) @@ -652,4 +654,4 @@ prompt = "a cup" # the masked out region will be replaced with this with autocast("cuda"): image = pipe(image=image, text=text, prompt=prompt).images[0] -``` \ No newline at end of file +```