Update README.md

#30
by wlj2020 - opened
Files changed (1) hide show
  1. README.md +15 -0
README.md CHANGED
@@ -59,6 +59,21 @@ with autocast("cuda"):
59
 
60
  image.save("test.png")
61
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
  ## Team Members and Acknowledgements
64
 
 
59
 
60
  image.save("test.png")
61
  ```
62
+ import torch
63
+ from torch import autocast
64
+ from diffusers import StableDiffusionPipeline
65
+
66
+ pipe = StableDiffusionPipeline.from_pretrained(
67
+ 'hakurei/waifu-diffusion',
68
+ torch_dtype=torch.float32
69
+ ).to('cuda')
70
+
71
+ prompt = "1girl, aqua eyes, baseball cap, blonde hair, closed mouth, earrings, green background, hat, hoop earrings, jewelry, looking at viewer, shirt, short hair, simple background, solo, upper body, yellow shirt"
72
+ with autocast("cuda"):
73
+ image = pipe(prompt, guidance_scale=6)["sample"][0]
74
+
75
+ image.save("test.png")
76
+
77
 
78
  ## Team Members and Acknowledgements
79