linrock commited on
Commit
3465ca9
1 Parent(s): a9b199e

Add example inference code

Browse files
Files changed (1) hide show
  1. README.md +15 -0
README.md ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```python
2
+ from diffusers import DiffusionPipeline
3
+ import torch
4
+
5
+ pipe = DiffusionPipeline.from_pretrained(
6
+ "playgroundai/playground-v2-256px-base",
7
+ torch_dtype=torch.float16,
8
+ use_safetensors=True,
9
+ variant="fp16"
10
+ )
11
+ pipe.to("cuda")
12
+
13
+ prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
14
+ image = pipe(prompt=prompt, width=256, height=256).images[0]
15
+ ```