Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/community/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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)
Expand Down Expand Up @@ -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]
```
```