Text-to-Image
stable-diffusion
patrickvonplaten commited on
Commit
ad3ae0f
1 Parent(s): bd8f749

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +36 -0
README.md CHANGED
@@ -66,6 +66,42 @@ Using the model to generate content that is cruel to individuals is a misuse of
66
  - Sharing of copyrighted or licensed material in violation of its terms of use.
67
  - Sharing content that is an alteration of copyrighted or licensed material in violation of its terms of use.
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  ## Limitations and Bias
70
 
71
  ### Limitations
 
66
  - Sharing of copyrighted or licensed material in violation of its terms of use.
67
  - Sharing content that is an alteration of copyrighted or licensed material in violation of its terms of use.
68
 
69
+ ## Diffusers
70
+
71
+ As soon as you have been added to this organization you can use stable diffusion out of the box!
72
+
73
+ Example:
74
+
75
+ ```
76
+ !pip install diffusers==0.2.2
77
+ ```
78
+
79
+ ```python
80
+ # make sure you're logged in with `huggingface-cli login`
81
+ from torch import autocast
82
+ from diffusers import StableDiffusionPipeline, LMSDiscreteScheduler
83
+
84
+ lms = LMSDiscreteScheduler(
85
+ beta_start=0.00085,
86
+ beta_end=0.012,
87
+ beta_schedule="scaled_linear"
88
+ )
89
+
90
+ pipe = StableDiffusionPipeline.from_pretrained(
91
+ "CompVis/stable-diffusion-v1-3-diffusers",
92
+ scheduler=lms,
93
+ use_auth_token=True
94
+ )
95
+
96
+ prompt = "a photo of an astronaut riding a horse on mars"
97
+ with autocast("cuda"):
98
+ image = pipe(prompt, width=768, guidance_scale=7)["sample"][0]
99
+
100
+ image.save("astronaut_rides_horse.png")
101
+ ```
102
+
103
+ For more in-detail explanations see [the stable diffusion notebook](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/stable_diffusion.ipynb).
104
+
105
  ## Limitations and Bias
106
 
107
  ### Limitations