Skip to content

Commit 06b8ae1

Browse files
committed
Minor copyedits
1 parent 3675228 commit 06b8ae1

File tree

3 files changed

+34
-29
lines changed

3 files changed

+34
-29
lines changed

guides/ipynb/keras_cv/generate_images_with_stable_diffusion.ipynb

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"[mixed precision](https://www.tensorflow.org/guide/mixed_precision) support,\n",
3434
"which together achieve state-of-the-art generation speed.\n",
3535
"\n",
36-
"In this guide, we will explore KerasCV's StableDiffusion implementation, show how to use\n",
36+
"In this guide, we will explore KerasCV's Stable Diffusion implementation, show how to use\n",
3737
"these powerful performance boosts, and explore the performance benefits\n",
3838
"that they offer.\n",
3939
"\n",
@@ -157,7 +157,7 @@
157157
},
158158
"source": [
159159
"The possibilities are literally endless (or at least extend to the boundaries of\n",
160-
"StableDiffusion's latent manifold)."
160+
"Stable Diffusion's latent manifold)."
161161
]
162162
},
163163
{
@@ -233,23 +233,23 @@
233233
"source": [
234234
"## Perks of KerasCV\n",
235235
"\n",
236-
"With several implementations of StableDiffusion publicly available why shoud you use\n",
236+
"With several implementations of Stable Diffusion publicly available why shoud you use\n",
237237
"`keras_cv.models.StableDiffusion`?\n",
238238
"\n",
239-
"Aside from the easy-to-use API, KerasCV's StableDiffusion model comes\n",
239+
"Aside from the easy-to-use API, KerasCV's Stable Diffusion model comes\n",
240240
"with some powerful advantages, including:\n",
241241
"\n",
242242
"- Graph mode execution\n",
243243
"- XLA compilation through `jit_compile=True`\n",
244244
"- Support for mixed precision computation\n",
245245
"\n",
246-
"When these are combined, the KerasCV StableDiffusion model runs orders of magnitude\n",
246+
"When these are combined, the KerasCV Stable Diffusion model runs orders of magnitude\n",
247247
"faster than naive implementations. This section shows how to enable all of these\n",
248248
"features, and the resulting performance gain yielded from using them.\n",
249249
"\n",
250250
"For the purposes of comparison, we ran benchmarks comparing the runtime of the\n",
251251
"[HuggingFace diffusers](https://github.com/huggingface/diffusers) implementation of\n",
252-
"StableDiffusion against the KerasCV implementation.\n",
252+
"Stable Diffusion against the KerasCV implementation.\n",
253253
"Both implementations were tasked to generate 3 images with a step count of 50 for each\n",
254254
"image. In this benchmark, we used a Tesla T4 GPU.\n",
255255
"\n",
@@ -285,7 +285,7 @@
285285
"\n",
286286
"\n",
287287
"While the runtime results from running this guide may vary, in our testing the KerasCV\n",
288-
"implementation of StableDiffusion is significantly faster than its PyTorch counterpart.\n",
288+
"implementation of Stable Diffusion is significantly faster than its PyTorch counterpart.\n",
289289
"This may be largely attributed to XLA compilation.\n",
290290
"\n",
291291
"**Note: The performance benefits of each optimization can vary\n",
@@ -605,7 +605,7 @@
605605
"source": [
606606
"## Conclusions\n",
607607
"\n",
608-
"KerasCV offers a state-of-the-art implementation of StableDiffusion -- and\n",
608+
"KerasCV offers a state-of-the-art implementation of Stable Diffusion -- and\n",
609609
"through the use of XLA and mixed precision, it delivers the fastest Stable Diffusion pipeline available as of September 2022.\n",
610610
"\n",
611611
"Normally, at the end of a keras.io tutorial we leave you with some future directions to continue in to learn.\n",
@@ -628,7 +628,7 @@
628628
"toc_visible": true
629629
},
630630
"kernelspec": {
631-
"display_name": "Python 3",
631+
"display_name": "Python 3.10.7 64-bit",
632632
"language": "python",
633633
"name": "python3"
634634
},
@@ -642,7 +642,12 @@
642642
"name": "python",
643643
"nbconvert_exporter": "python",
644644
"pygments_lexer": "ipython3",
645-
"version": "3.7.0"
645+
"version": "3.10.7"
646+
},
647+
"vscode": {
648+
"interpreter": {
649+
"hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49"
650+
}
646651
}
647652
},
648653
"nbformat": 4,

guides/keras_cv/generate_images_with_stable_diffusion.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Authors: [fchollet](https://twitter.com/fchollet), [lukewood](https://twitter.com/luke_wood_ml), [divamgupta](https://github.com/divamgupta)
44
Date created: 2022/09/25
55
Last modified: 2022/09/25
6-
Description: Generate new images using KerasCV's StableDiffusion model.
6+
Description: Generate new images using KerasCV's Stable Diffusion model.
77
"""
88

99
"""
@@ -20,7 +20,7 @@
2020
[mixed precision](https://www.tensorflow.org/guide/mixed_precision) support,
2121
which together achieve state-of-the-art generation speed.
2222
23-
In this guide, we will explore KerasCV's StableDiffusion implementation, show how to use
23+
In this guide, we will explore KerasCV's Stable Diffusion implementation, show how to use
2424
these powerful performance boosts, and explore the performance benefits
2525
that they offer.
2626
@@ -82,13 +82,13 @@ def plot_images(images):
8282

8383
"""
8484
The possibilities are literally endless (or at least extend to the boundaries of
85-
StableDiffusion's latent manifold).
85+
Stable Diffusion's latent manifold).
8686
"""
8787

8888
"""
8989
## Wait, how does this even work?
9090
91-
Unlike what you might expect at this point, StableDiffusion doesn't actually run on magic.
91+
Unlike what you might expect at this point, Stable Diffusion doesn't actually run on magic.
9292
It's a kind of "latent diffusion model". Let's dig into what that means.
9393
9494
You may be familiar with the idea of _super-resolution_:
@@ -148,23 +148,23 @@ def plot_images(images):
148148
"""
149149
## Perks of KerasCV
150150
151-
With several implementations of StableDiffusion publicly available why shoud you use
151+
With several implementations of Stable Diffusion publicly available why shoud you use
152152
`keras_cv.models.StableDiffusion`?
153153
154-
Aside from the easy-to-use API, KerasCV's StableDiffusion model comes
154+
Aside from the easy-to-use API, KerasCV's Stable Diffusion model comes
155155
with some powerful advantages, including:
156156
157157
- Graph mode execution
158158
- XLA compilation through `jit_compile=True`
159159
- Support for mixed precision computation
160160
161-
When these are combined, the KerasCV StableDiffusion model runs orders of magnitude
161+
When these are combined, the KerasCV Stable Diffusion model runs orders of magnitude
162162
faster than naive implementations. This section shows how to enable all of these
163163
features, and the resulting performance gain yielded from using them.
164164
165165
For the purposes of comparison, we ran benchmarks comparing the runtime of the
166166
[HuggingFace diffusers](https://github.com/huggingface/diffusers) implementation of
167-
StableDiffusion against the KerasCV implementation.
167+
Stable Diffusion against the KerasCV implementation.
168168
Both implementations were tasked to generate 3 images with a step count of 50 for each
169169
image. In this benchmark, we used a Tesla T4 GPU.
170170
@@ -200,7 +200,7 @@ def plot_images(images):
200200
201201
202202
While the runtime results from running this guide may vary, in our testing the KerasCV
203-
implementation of StableDiffusion is significantly faster than its PyTorch counterpart.
203+
implementation of Stable Diffusion is significantly faster than its PyTorch counterpart.
204204
This may be largely attributed to XLA compilation.
205205
206206
**Note: The performance benefits of each optimization can vary
@@ -370,7 +370,7 @@ def plot_images(images):
370370
"""
371371
## Conclusions
372372
373-
KerasCV offers a state-of-the-art implementation of StableDiffusion -- and
373+
KerasCV offers a state-of-the-art implementation of Stable Diffusion -- and
374374
through the use of XLA and mixed precision, it delivers the fastest Stable Diffusion pipeline available as of September 2022.
375375
376376
Normally, at the end of a keras.io tutorial we leave you with some future directions to continue in to learn.

guides/md/keras_cv/generate_images_with_stable_diffusion.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ These include [XLA compilation](https://www.tensorflow.org/xla) and
2424
[mixed precision](https://www.tensorflow.org/guide/mixed_precision) support,
2525
which together achieve state-of-the-art generation speed.
2626

27-
In this guide, we will explore KerasCV's StableDiffusion implementation, show how to use
27+
In this guide, we will explore KerasCV's Stable Diffusion implementation, show how to use
2828
these powerful performance boosts, and explore the performance benefits
2929
that they offer.
3030

@@ -112,12 +112,12 @@ plot_images(images)
112112

113113

114114
The possibilities are literally endless (or at least extend to the boundaries of
115-
StableDiffusion's latent manifold).
115+
Stable Diffusion's latent manifold).
116116

117117
---
118118
## Wait, how does this even work?
119119

120-
Unlike what you might expect at this point, StableDiffusion doesn't actually run on magic.
120+
Unlike what you might expect at this point, Stable Diffusion doesn't actually run on magic.
121121
It's a kind of "latent diffusion model". Let's dig into what that means.
122122

123123
You may be familiar with the idea of _super-resolution_:
@@ -176,23 +176,23 @@ As Feynman said about the universe: _"It's not complicated, it's just a lot of i
176176
---
177177
## Perks of KerasCV
178178

179-
With several implementations of StableDiffusion publicly available why shoud you use
179+
With several implementations of Stable Diffusion publicly available why shoud you use
180180
`keras_cv.models.StableDiffusion`?
181181

182-
Aside from the easy-to-use API, KerasCV's StableDiffusion model comes
182+
Aside from the easy-to-use API, KerasCV's Stable Diffusion model comes
183183
with some powerful advantages, including:
184184

185185
- Graph mode execution
186186
- XLA compilation through `jit_compile=True`
187187
- Support for mixed precision computation
188188

189-
When these are combined, the KerasCV StableDiffusion model runs orders of magnitude
189+
When these are combined, the KerasCV Stable Diffusion model runs orders of magnitude
190190
faster than naive implementations. This section shows how to enable all of these
191191
features, and the resulting performance gain yielded from using them.
192192

193193
For the purposes of comparison, we ran benchmarks comparing the runtime of the
194194
[HuggingFace diffusers](https://github.com/huggingface/diffusers) implementation of
195-
StableDiffusion against the KerasCV implementation.
195+
Stable Diffusion against the KerasCV implementation.
196196
Both implementations were tasked to generate 3 images with a step count of 50 for each
197197
image. In this benchmark, we used a Tesla T4 GPU.
198198

@@ -228,7 +228,7 @@ many times). Regardless, here are the cold-start numbers:
228228

229229

230230
While the runtime results from running this guide may vary, in our testing the KerasCV
231-
implementation of StableDiffusion is significantly faster than its PyTorch counterpart.
231+
implementation of Stable Diffusion is significantly faster than its PyTorch counterpart.
232232
This may be largely attributed to XLA compilation.
233233

234234
**Note: The performance benefits of each optimization can vary
@@ -501,7 +501,7 @@ a text prompt on an A100 GPU.
501501
---
502502
## Conclusions
503503

504-
KerasCV offers a state-of-the-art implementation of StableDiffusion -- and
504+
KerasCV offers a state-of-the-art implementation of Stable Diffusion -- and
505505
through the use of XLA and mixed precision, it delivers the fastest Stable Diffusion pipeline available as of September 2022.
506506

507507
Normally, at the end of a keras.io tutorial we leave you with some future directions to continue in to learn.

0 commit comments

Comments
 (0)