hearmeneigh commited on
Commit
e7e7fcf
1 Parent(s): a5e4558

Create PYTHON.md

Browse files
Files changed (1) hide show
  1. guides/PYTHON.md +16 -0
guides/PYTHON.md ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ```