hearmeneigh commited on
Commit
0de0af1
1 Parent(s): ed990a6

Create guides/PYTHON.md

Browse files
Files changed (1) hide show
  1. guides/PYTHON.md +17 -0
guides/PYTHON.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Python Text2Image Inference
2
+
3
+ ```python
4
+ from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
5
+ import torch
6
+
7
+ repo_id = "hearmeneigh/sd21-e621-rising-v1"
8
+ pipe = DiffusionPipeline.from_pretrained(repo_id, torch_dtype=torch.float16, revision="fp16")
9
+
10
+ pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
11
+ pipe = pipe.to("cuda")
12
+
13
+ prompt = "anthro species:equine solo male biped standing rating:questionable evil_grin seductive looking_at_viewer"
14
+ image = pipe(prompt, guidance_scale=9, num_inference_steps=25).images[0]
15
+ image.save("horse.png")
16
+ ```
17
+