{"id":339746,"date":"2022-10-14T21:00:08","date_gmt":"2022-10-14T21:00:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=339746"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=339746","title":{"rendered":"<span>\u0412\u044b\u0441\u043e\u043a\u043e\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 KerasCV \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Stable Diffusion<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/693322\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/544\/297\/fa0\/544297fa0f9ed573e5d2ad1c9f36b863.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/544\/297\/fa0\/544297fa0f9ed573e5d2ad1c9f36b863.png\"\/><\/a><\/p>\n<p>  <\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 KerasCV, <a href=\"https:\/\/stability.ai\/\">stability.ai<\/a> \u0438 <a href=\"https:\/\/github.com\/CompVis\/stable-diffusion\">Stable Diffusion<\/a>. \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u043a \u0441\u0442\u0430\u0440\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e <u><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_141022&amp;utm_term=lead\">\u0444\u043b\u0430\u0433\u043c\u0430\u043d\u0441\u043a\u043e\u0433\u043e \u043a\u0443\u0440\u0441\u0430 \u043f\u043e Data Science<\/a><\/u>.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>Stable Diffusion \u2014 \u044d\u0442\u043e \u043c\u043e\u0449\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f\u043c \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0420\u0435\u0448\u0435\u043d\u0438\u0439 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f\u043c \u043d\u0435\u043c\u0430\u043b\u043e, \u043d\u043e KerasCV \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437 \u043d\u0438\u0445 \u0440\u044f\u0434\u043e\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 <a href=\"https:\/\/www.tensorflow.org\/xla\">\u043a\u043e\u043c\u043f\u0438\u043b\u043b\u044f\u0446\u0438\u0435\u0439 XLA (\u0443\u0441\u043a\u043e\u0440\u0435\u043d\u043d\u043e\u0439 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0430\u043b\u0433\u0435\u0431\u0440\u044b)<\/a> \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 <a href=\"https:\/\/www.tensorflow.org\/guide\/mixed_precision\">\u00ab\u0441\u043c\u0435\u0448\u0430\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438\u00bb<\/a>. \u0412\u043c\u0435\u0441\u0442\u0435 \u043e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e Stable Diffusion \u043e\u0442 KerasCV, \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u043c\u043e\u0449\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0438 \u0438\u0437\u0443\u0447\u0438\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d\u0438 \u0434\u0430\u044e\u0442.<\/p>\n<p>  <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u0430\u043a\u0435\u0442\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0441 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">!pip install --upgrade keras-cv<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">import time import keras_cv from tensorflow import keras import matplotlib.pyplot as plt<\/code><\/pre>\n<p>  <\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432, \u0437\u0434\u0435\u0441\u044c \u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f\u043c \u044d\u0442\u043e \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0435\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043b\u044c\u043d\u0430 <code>keras_cv.models.StableDiffusion()<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">model = keras_cv.models.StableDiffusion(img_width=512, img_height=512) <\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00ab\u0444\u043e\u0442\u043e \u0430\u0441\u0442\u0440\u043e\u043d\u0430\u0432\u0442\u0430 \u0432\u0435\u0440\u0445\u043e\u043c \u043d\u0430 \u043a\u043e\u043d\u0435\u00bb (\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u2014 \u00abphotograph of an astronaut riding a horse\u00bb):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">images = model.text_to_image(\"photograph of an astronaut riding a horse\", batch_size=3)   def plot_images(images):     plt.figure(figsize=(20, 20))     for i in range(len(images)):         ax = plt.subplot(1, len(images), i + 1)         plt.imshow(images[i])         plt.axis(\"off\")   plot_images(images)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">25\/25 [==============================] - 19s 317ms\/step <\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/551\/1cb\/3ed\/5511cb3ed9a41966baabd30bda565e38.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/551\/1cb\/3ed\/5511cb3ed9a41966baabd30bda565e38.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e!<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u0432\u0435\u0441\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00ab\u0441\u0438\u043c\u043f\u0430\u0442\u0438\u0447\u043d\u0430\u044f \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u0430\u044f \u043b\u0435\u0442\u0430\u044e\u0449\u0430\u044f \u0441\u043e\u0431\u0430\u043a\u0430, \u0444\u044d\u043d\u0442\u0435\u0437\u0438-\u0430\u0440\u0442\u00bb, \u00ab\u0437\u043e\u043b\u043e\u0442\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430, \u0432\u044b\u0441\u043e\u043a\u043e\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e, \u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u0438\u0437\u044f\u0449\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430, \u0447\u0451\u0442\u043a\u0430\u044f \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u043a\u0430\u00bb, \u00ab\u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u0438\u0437\u0430\u0439\u043d, \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0430, \u0446\u0438\u0444\u0440\u043e\u0432\u0430\u044f \u0436\u0438\u0432\u043e\u043f\u0438\u0441\u044c, \u0442\u0430\u0439\u043d\u0430, \u043f\u0440\u0438\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u00bb:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">images = model.text_to_image(     \"cute magical flying dog, fantasy art, \"     \"golden color, high quality, highly detailed, elegant, sharp focus, \"     \"concept art, character concepts, digital painting, mystery, adventure\",     batch_size=3, ) plot_images(images)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">25\/25 [==============================] - 8s 316ms\/step <\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/6f0\/4b2\/37b\/6f04b237bc2d8bb68e9ece3667772d4b.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/6f0\/4b2\/37b\/6f04b237bc2d8bb68e9ece3667772d4b.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0442 \u043f\u0440\u0435\u0434\u0435\u043b\u0430 (\u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043e\u043d\u0438 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0432\u0441\u0451 \u0441\u043a\u0440\u044b\u0442\u043e\u0435 \u043c\u043d\u043e\u0433\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0435 Stable Diffusion).<\/p>\n<p>  <\/p>\n<h2>\u0421\u0442\u043e\u043f, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?<\/h2>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0431\u044b \u0432\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u0435\u0431\u0435 \u043d\u0438 \u0432\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u043b\u0438, \u043d\u0438\u0447\u0435\u0433\u043e \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u043e\u0433\u043e \u0432 Stable Diffusion \u043d\u0435\u0442. \u042d\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u00ab\u043b\u0430\u0442\u0435\u043d\u0442\u043d\u043e\u0439 \u0434\u0438\u0444\u0444\u0443\u0437\u0438\u043e\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438\u00bb. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u043a\u043e\u043f\u0430\u0435\u043c\u0441\u044f \u0434\u043e \u0441\u043c\u044b\u0441\u043b\u0430 \u044d\u0442\u043e\u0433\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u0430\u043c \u0437\u043d\u0430\u043a\u043e\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f <em>\u0441\u0432\u0435\u0440\u0445\u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/em> (super-resolution): \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f <em>\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044e \u0448\u0443\u043c\u0430<\/em> \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438. \u0422\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043c\u044b \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u0432\u0435\u0440\u0441\u0438\u044e \u0441 \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c. \u041c\u043e\u0434\u0435\u043b\u044c \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e \u0432\u043e\u043b\u0448\u0435\u0431\u0441\u0442\u0432\u0443 \u00ab\u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c\u00bb \u0443\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u0448\u0443\u043c\u0430 \u043d\u0430 \u0444\u043e\u0442\u043e \u0441 \u043d\u0438\u0437\u043a\u0438\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043e\u043d\u0430 \u0434\u043e\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043b\u043b\u044e\u0437\u0438\u044e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b\u0445 \u0434\u0435\u0442\u0430\u043b\u0435\u0439. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0441\u0432\u0435\u0440\u0445\u0432\u044b\u0441\u043e\u043a\u043e\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u2014 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430\u0445 Keras.io:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/keras.io\/examples\/vision\/super_resolution_sub_pixel\/\">Image Super-Resolution using an Efficient Sub-Pixel CNN<\/a>;  <\/li>\n<li><a href=\"https:\/\/keras.io\/examples\/vision\/edsr\/\">Enhanced Deep Residual Networks for single-image super-resolution<\/a>.  <\/li>\n<\/ul>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ut\/t9\/9q\/utt99qe4quhe13zcrc2vpmqecva.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ut\/t9\/9q\/utt99qe4quhe13zcrc2vpmqecva.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0418, \u0435\u0441\u043b\u0438 \u0432\u044b \u0432\u044b\u0436\u0430\u043b\u0438 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0438\u0434\u0435\u0438 \u0432\u0441\u0451, \u0442\u043e \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u0435 \u0441\u0435\u0431\u044f: \u0430 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u00ab\u0447\u0438\u0441\u0442\u043e\u043c \u0448\u0443\u043c\u0435\u00bb? \u0422\u043e\u0433\u0434\u0430 \u0435\u0439 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u00ab\u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0448\u0443\u043c \u0443 \u0448\u0443\u043c\u0430\u00bb \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u043c \u044d\u0442\u043e \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437, \u0438 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0448\u0443\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0432 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0447\u0451\u0442\u043a\u043e\u0435 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>  <\/p>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u0430\u044f \u043c\u044b\u0441\u043b\u044c \u043b\u0430\u0442\u0435\u043d\u0442\u043d\u043e\u0439 \u0434\u0438\u0444\u0444\u0443\u0437\u0438\u0438 \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 <a href=\"https:\/\/arxiv.org\/abs\/2112.10752\">High-Resolution Image Synthesis with Latent Diffusion Models<\/a> \u0432 2020 \u0433\u043e\u0434\u0443. \u0427\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0434\u0438\u0444\u0444\u0443\u0437\u0438\u0438, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043d\u0430 Keras.io <a href=\"https:\/\/keras.io\/examples\/generative\/ddim\/\">\u041d\u0435\u044f\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0438\u0444\u0444\u0443\u0437\u0438\u0438 \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0448\u0443\u043c\u0430 (Denoising Diffusion Implicit Models)<\/a>.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/2c6\/7e6\/939\/2c67e69399087ea9720df8d86f4eee5f.gif\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/2c6\/7e6\/939\/2c67e69399087ea9720df8d86f4eee5f.gif\"\/><\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043e\u0442 \u043b\u0430\u0442\u0435\u043d\u0442\u043d\u043e\u0439 \u0434\u0438\u0444\u0444\u0443\u0437\u0438\u0438 \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e: \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u043c\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u00ab\u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u00bb (conditioning) \u2014 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0435 \u043a \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0443 \u0448\u0443\u043c\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u0430, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0431\u043e\u0439 \u043a\u0443\u0441\u043e\u0447\u0435\u043a \u0442\u0435\u043a\u0441\u0442\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u0440 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439 <code>{image: caption}<\/code>.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0434\u0430\u0451\u0442 \u043d\u0430\u0447\u0430\u043b\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 Stable Diffusion, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0442\u0440\u0451\u0445 \u0431\u043b\u043e\u043a\u043e\u0432:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043a\u043e\u0434\u0435\u0440 \u0442\u0435\u043a\u0441\u0442\u0430. \u0411\u043b\u043e\u043a \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432 \u043b\u0430\u0442\u0435\u043d\u0442\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 (latent vector);<\/li>\n<li>\u0434\u0438\u0444\u0444\u0443\u0437\u0438\u043e\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c. \u041e\u043d\u0430 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0448\u0443\u043c \u0441 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f 64&#215;64 \u0432 \u043b\u0430\u0442\u0435\u043d\u0442\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438;<\/li>\n<li>\u0434\u0435\u043a\u043e\u0434\u0435\u0440 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f 64&#215;64 \u0432 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c 512&#215;512.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432, \u044f\u0437\u044b\u043a\u043e\u0432\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u00ab\u0437\u0430\u043c\u043e\u0440\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u0435\u0441\u0430\u043c\u0438\u00bb. \u0417\u0430\u0442\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u043c \u0448\u0443\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u00ab\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0448\u0443\u043c\u0430\u00bb \u0432 \u0434\u0435\u043a\u043e\u0434\u0435\u0440\u0435. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0445 50. \u0418 \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435, \u0442\u0435\u043c \u043a\u0440\u0430\u0441\u0438\u0432\u0435\u0435 \u0438 \u0447\u0451\u0442\u0447\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 50 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0441\u043a\u0440\u044b\u0442\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 64&#215;64 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u0434\u0435\u043a\u043e\u0434\u0435\u0440, \u0447\u0442\u043e \u0434\u0430\u0451\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0443\u044e \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/sc\/ot\/-b\/scot-bsi_tvn2lbhiqkvpjc0fcg.png\" alt=\"\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 Stable Diffusion\" data-src=\"https:\/\/habrastorage.org\/webt\/sc\/ot\/-b\/scot-bsi_tvn2lbhiqkvpjc0fcg.png\"\/><\/p>\n<p><em>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 Stable Diffusion<\/em>  <\/p>\n<p>\u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430: \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Keras \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0430 500 \u0441\u0442\u0440\u043e\u043a \u0432 \u043e\u0431\u0449\u0435\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/keras-team\/keras-cv\/blob\/master\/keras_cv\/models\/generative\/stable_diffusion\/text_encoder.py\">text_encoder.py<\/a>: 87 LOC;  <\/li>\n<li><a href=\"https:\/\/github.com\/keras-team\/keras-cv\/blob\/master\/keras_cv\/models\/generative\/stable_diffusion\/diffusion_model.py\">diffusion_model.py<\/a>: 181 LOC;  <\/li>\n<li><a href=\"https:\/\/github.com\/keras-team\/keras-cv\/blob\/master\/keras_cv\/models\/generative\/stable_diffusion\/decoder.py\">decoder.py<\/a>: 86 LOC;<\/li>\n<li><a href=\"https:\/\/github.com\/keras-team\/keras-cv\/blob\/master\/keras_cv\/models\/generative\/stable_diffusion\/stable_diffusion.py\">stable_diffusion.py<\/a>: 106 LOC.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u043e\u0432 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u0438\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0439 \u0440\u0430\u0431\u043e\u0442\u0430 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u043e\u043b\u0448\u0435\u0431\u0441\u0442\u0432\u043e\u043c. \u0424\u0435\u0439\u043d\u043c\u0430\u043d \u043e \u0412\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u043a\u0430\u0437\u0430\u043b: <em>\u00ab\u041e\u043d\u0430 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u0430, \u0435\u0451 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043d\u043e\u0433\u043e!\u00bb<\/em><\/p>\n<p>  <\/p>\n<h2>\u00ab\u041f\u043b\u044e\u0448\u043a\u0438\u00bb KerasCV<\/h2>\n<p>  <\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 Stable Diffusion \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e <a href=\"https:\/\/keras.io\/api\/keras_cv\/models\/stable_diffusion#stablediffusion-class\">keras_cv.models.StableDiffusion<\/a>?<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e API \u043c\u043e\u0434\u0435\u043b\u044c Stable Diffusion \u043e\u0442 KerasCV \u0434\u0430\u0451\u0442 \u0432\u0430\u0436\u043d\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u0433\u0440\u0430\u0444\u043e\u0432\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435;<\/li>\n<li>\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e XLA \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 jit_compile=True;<\/li>\n<li>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0441\u043e \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044f \u0432\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430, \u043c\u043e\u0434\u0435\u043b\u044c Stable Diffusion \u043e\u0442 KerasCV \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043a\u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043d\u0430\u0438\u0432\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439. \u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0434\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u043c\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u043b\u0438 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Stable Diffusion \u0434\u043b\u044f \u00ab\u0434\u0438\u0444\u0444\u0443\u0437\u043e\u0440\u043e\u0432\u00bb \u043e\u0442 <a href=\"https:\/\/github.com\/huggingface\/diffusers\">HuggingFace<\/a> \u0438 \u043e\u0442 KerasCV. \u0412 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0443 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c 3 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441 50 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043d\u0430 Tesla T4.<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/github.com\/LukeWood\/stable-diffusion-performance-benchmarks\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a> \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u043d\u0430 GitHub, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430 Colab \u0438 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<a href=\"https:\/\/github.com\/LukeWood\/stable-diffusion-performance-benchmarks\">.<\/a> \u0412\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<thead>\n<tr>\n<th>\u0413\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440<\/th>\n<th>\u041c\u043e\u0434\u0435\u043b\u044c<\/th>\n<th>\u0412\u0440\u0435\u043c\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438<\/th>\n<\/tr>\n<tr>\n<th>Tesla T4<\/th>\n<th>KerasCV (\u043f\u0440\u0438 \u0442\u0451\u043f\u043b\u043e\u043c \u0441\u0442\u0430\u0440\u0442\u0435)<\/th>\n<th>28.97s<\/th>\n<\/tr>\n<tr>\n<th>Tesla T4<\/th>\n<th>diffusers (\u043f\u0440\u0438 \u0442\u0451\u043f\u043b\u043e\u043c \u0441\u0442\u0430\u0440\u0442\u0435)<\/th>\n<th>41.33s<\/th>\n<\/tr>\n<tr>\n<th>Tesla V100<\/th>\n<th>KerasCV (\u043f\u0440\u0438 \u0442\u0451\u043f\u043b\u043e\u043c \u0441\u0442\u0430\u0440\u0442\u0435)<\/th>\n<th>12.45<\/th>\n<\/tr>\n<tr>\n<th>Tesla V100<\/th>\n<th>diffusers (\u043f\u0440\u0438 \u0442\u0451\u043f\u043b\u043e\u043c \u0441\u0442\u0430\u0440\u0442\u0435)<\/th>\n<th>12.72<\/th>\n<\/tr>\n<\/thead>\n<\/table>\n<\/div>\n<p>  <\/p>\n<p>\u041d\u0430 Tesla T4 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 30%! \u0425\u043e\u0442\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0430 V100 \u043d\u0435 \u0441\u0442\u043e\u043b\u044c \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u0435\u0442, \u0432 \u0446\u0435\u043b\u043e\u043c \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0430\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u0445 NVIDIA \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 KerasCV.<\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0434\u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u044b \u043c\u044b \u043f\u0440\u0438\u0432\u0435\u043b\u0438 \u0432\u0440\u0435\u043c\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u0445\u043e\u043b\u043e\u0434\u043d\u043e\u043c \u0438 \u043f\u0440\u0438 \u043f\u0440\u043e\u0433\u0440\u0435\u0442\u043e\u043c \u0441\u0442\u0430\u0440\u0442\u0435. \u0412\u0440\u0435\u043c\u044f \u0445\u043e\u043b\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0430 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0435\u0434\u0438\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435, \u0433\u0434\u0435 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043c\u043e\u0434\u0435\u043b\u0438, \u043e\u043d\u043e \u043d\u0438\u0447\u0442\u043e\u0436\u043d\u043e \u043c\u0430\u043b\u043e. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u0446\u0438\u0444\u0440\u044b \u0434\u043b\u044f \u0445\u043e\u043b\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0440\u0442\u0430:<\/p>\n<p>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<thead>\n<tr>\n<th>\u0413\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440<\/th>\n<th>\u041c\u043e\u0434\u0435\u043b\u044c<\/th>\n<th>\u0412\u0440\u0435\u043c\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438<\/th>\n<\/tr>\n<tr>\n<th>Tesla T4<\/th>\n<th>KerasCV (\u043f\u0440\u0438 \u0445\u043e\u043b\u043e\u0434\u043d\u043e\u043c \u0441\u0442\u0430\u0440\u0442\u0435)<\/th>\n<th>83.47s<\/th>\n<\/tr>\n<tr>\n<th>Tesla T4<\/th>\n<th>diffusers (\u043f\u0440\u0438 \u0445\u043e\u043b\u043e\u0434\u043d\u043e\u043c \u0441\u0442\u0430\u0440\u0442\u0435)<\/th>\n<th>46.27s<\/th>\n<\/tr>\n<tr>\n<th>Tesla V100<\/th>\n<th>KerasCV (\u043f\u0440\u0438 \u0445\u043e\u043b\u043e\u0434\u043d\u043e\u043c \u0441\u0442\u0430\u0440\u0442\u0435)<\/th>\n<th>76.43<\/th>\n<\/tr>\n<tr>\n<th>Tesla V100<\/th>\n<th>diffusers (\u043f\u0440\u0438 \u0445\u043e\u043b\u043e\u0434\u043d\u043e\u043c \u0441\u0442\u0430\u0440\u0442\u0435)<\/th>\n<th>13.90<\/th>\n<\/tr>\n<\/thead>\n<\/table>\n<\/div>\n<p>  <\/p>\n<p>\u0425\u043e\u0442\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c\u0438, \u0443 \u043d\u0430\u0441 \u0432 \u0442\u0435\u0441\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Stable Diffusion \u043d\u0430 KerasCV \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u043d\u0430 PyTorch. \u0412 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0435\u0439 XLA.<\/p>\n<p>  <\/p>\n<blockquote><p>\u042d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u00ab\u0436\u0435\u043b\u0435\u0437\u0430\u00bb \u043a \u0434\u0440\u0443\u0433\u043e\u0439.<\/p><\/blockquote>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0441\u043f\u044b\u0442\u0430\u0435\u043c \u043d\u0430\u0448\u0443 \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u00ab\u0421\u0438\u043c\u043f\u0430\u0442\u0438\u0447\u043d\u0430\u044f \u0432\u044b\u0434\u0440\u0430 \u0434\u0435\u0440\u0436\u0438\u0442 \u0440\u0430\u043a\u0443\u0448\u043a\u0438 \u0432 \u0440\u0430\u0434\u0443\u0436\u043d\u043e\u043c \u0432\u043e\u0434\u043e\u0432\u043e\u0440\u043e\u0442\u0435. \u0410\u043a\u0432\u0430\u0440\u0435\u043b\u044c\u00bb:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">benchmark_result = [] start = time.time() images = model.text_to_image(     \"A cute otter in a rainbow whirlpool holding shells, watercolor\",     batch_size=3, ) end = time.time() benchmark_result.append([\"Standard\", end - start]) plot_images(images)  print(f\"Standard model: {(end - start):.2f} seconds\") keras.backend.clear_session()  # Clear session to preserve memory.<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">25\/25 [==============================] - 8s 316ms\/step Standard model: 8.17 seconds<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/3_\/qy\/ci\/3_qycibe1h8emp-ybpthhlhoqdw.png\" data-src=\"https:\/\/habrastorage.org\/webt\/3_\/qy\/ci\/3_qycibe1h8emp-ybpthhlhoqdw.png\"\/><\/p>\n<p>  <\/p>\n<h3>\u0421\u043c\u0435\u0448\u0430\u043d\u043d\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c<\/h3>\n<p>  <\/p>\n<p>\u00ab\u0421\u043c\u0435\u0448\u0430\u043d\u043d\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u00bb \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e float16, \u0445\u0440\u0430\u043d\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0435\u0441\u0430 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 float32. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 float16 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u043c\u0438 \u044f\u0434\u0440\u0430\u043c\u0438, \u0447\u0435\u043c \u0430\u043d\u0430\u043b\u043e\u0433\u0438 \u0434\u043b\u044f float32 \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u0445 NVIDIA.<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0432 Keras (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0434\u043b\u044f <a href=\"https:\/\/keras.io\/api\/keras_cv\/models\/stable_diffusion#stablediffusion-class\">keras_cv.models.StableDiffusion<\/a>) \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">keras.mixed_precision.set_global_policy(\"mixed_float16\") <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">INFO:tensorflow:Mixed precision compatibility check (mixed_float16): OK Your GPU will likely run quickly with dtype policy mixed_float16 as it has compute capability of at least 7.0. Your GPU: NVIDIA A100-SXM4-40GB, compute capability 8.0<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">odel = keras_cv.models.StableDiffusion()  print(\"Compute dtype:\", model.diffusion_model.compute_dtype) print(     \"Variable dtype:\",     model.diffusion_model.variable_dtype, )<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">Compute dtype: float16 Variable dtype: float32<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u0430\u044f \u0432\u044b\u0448\u0435 \u043c\u043e\u0434\u0435\u043b\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0440\u0430\u0441\u0447\u0451\u0442\u044b \u0441\u043e \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e. \u0410 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 float16 \u043f\u0440\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e float32.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\"># Warm up model to run graph tracing before benchmarking. model.text_to_image(\"warming up the model\", batch_size=3)  start = time.time() images = model.text_to_image(     \"a cute magical flying dog, fantasy art, \"     \"golden color, high quality, highly detailed, elegant, sharp focus, \"     \"concept art, character concepts, digital painting, mystery, adventure\",     batch_size=3, ) end = time.time() benchmark_result.append([\"Mixed Precision\", end - start]) plot_images(images)  print(f\"Mixed precision model: {(end - start):.2f} seconds\") keras.backend.clear_session()<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">25\/25 [==============================] - 15s 226ms\/step 25\/25 [==============================] - 6s 226ms\/step Mixed precision model: 6.02 seconds<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/yo\/qd\/p-\/yoqdp-e27-p6z1bjyiwls8qojls.png\" data-src=\"https:\/\/habrastorage.org\/webt\/yo\/qd\/p-\/yoqdp-e27-p6z1bjyiwls8qojls.png\"\/><\/p>\n<p>  <\/p>\n<h3>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f XLA<\/h3>\n<p>  <\/p>\n<p>TensorFlow \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u043b\u044f\u0442\u043e\u0440 XLA <a href=\"https:\/\/www.tensorflow.org\/xla\">XLA: Accelerated Linear Algebra \u2014 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u043d\u0430\u044f \u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f \u0430\u043b\u0433\u0435\u0431\u0440\u0430<\/a>. <a href=\"https:\/\/keras.io\/api\/keras_cv\/models\/stable_diffusion#stablediffusion-class\">keras_cv.models.StableDiffusion<\/a> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 jit_compile \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 True \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e XLA \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044e.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u044d\u0442\u0438\u043c \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441 \u00ab\u043a\u0440\u0435\u0441\u043b\u043e\u043c \u0446\u0432\u0435\u0442\u0430 \u0430\u0432\u043e\u043a\u0430\u0434\u043e\u00bb:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\"># Set back to the default for benchmarking purposes. keras.mixed_precision.set_global_policy(\"float32\")  model = keras_cv.models.StableDiffusion(jit_compile=True) # Before we benchmark the model, we run inference once to make sure the TensorFlow # graph has already been traced. images = model.text_to_image(\"An avocado armchair\", batch_size=3) plot_images(images)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">25\/25 [==============================] - 36s 245ms\/step <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/6m\/bc\/do\/6mbcdomvymsagahlesxehrtfy7q.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/6m\/bc\/do\/6mbcdomvymsagahlesxehrtfy7q.png\"\/>  <\/p>\n<p>\u041e\u0446\u0435\u043d\u0438\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 XLA:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">start = time.time() images = model.text_to_image(     \"A cute otter in a rainbow whirlpool holding shells, watercolor\",     batch_size=3, ) end = time.time() benchmark_result.append([\"XLA\", end - start]) plot_images(images)  print(f\"With XLA: {(end - start):.2f} seconds\") keras.backend.clear_session()<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">25\/25 [==============================] - 6s 245ms\/step With XLA: 6.27 seconds<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/du\/kf\/kv\/dukfkvv4aradbf85jbei_izq-zq.png\" data-src=\"https:\/\/habrastorage.org\/webt\/du\/kf\/kv\/dukfkvv4aradbf85jbei_izq-zq.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 A100 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0434\u0432\u0443\u043a\u0440\u0430\u0442\u043d\u043e\u0435 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435. \u0427\u0443\u0434\u0435\u0441\u0430!<\/p>\n<p>  <\/p>\n<h2>\u0421\u043e\u0431\u0435\u0440\u0451\u043c \u0432\u0441\u0451 \u0432\u043e\u0435\u0434\u0438\u043d\u043e<\/h2>\n<p>  <\/p>\n<p>\u0418 \u043a\u0430\u043a \u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432 \u043c\u0438\u0440\u0435 (\u043f\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043d\u0430 \u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044c 2022 \u0433\u043e\u0434\u0430) \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u0434\u0438\u0444\u0444\u0443\u0437\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430?<\/p>\n<p>  <\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0432\u0443\u0445 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">keras.mixed_precision.set_global_policy(\"mixed_float16\") model = keras_cv.models.StableDiffusion(jit_compile=True)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u00ab\u041f\u043b\u044e\u0448\u0435\u0432\u044b\u0435 \u043c\u0438\u0448\u043a\u0438 \u0432\u0435\u0434\u0443\u0442 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f\u00bb:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\"># Let's make sure to warm up the model images = model.text_to_image(     \"Teddy bears conducting machine learning research\",     batch_size=3, ) plot_images(images)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">25\/25 [==============================] - 39s 157ms\/step <\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/4d6\/601\/216\/4d6601216059384e42ab7fb2717d04a9.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/4d6\/601\/216\/4d6601216059384e42ab7fb2717d04a9.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442? \u0421\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f! \u041f\u0443\u0441\u0442\u044c \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u00ab\u0422\u0430\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0442\u0451\u043c\u043d\u044b\u0439 \u043d\u0435\u0437\u043d\u0430\u043a\u043e\u043c\u0435\u0446 \u043f\u043e\u0441\u0435\u0449\u0430\u0435\u0442 \u0435\u0433\u0438\u043f\u0435\u0442\u0441\u043a\u0438\u0435 \u043f\u0438\u0440\u0430\u043c\u0438\u0434\u044b\u00bb, \u00ab\u0432\u044b\u0441\u043e\u043a\u043e\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e, \u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u0438\u0437\u044f\u0449\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430, \u0447\u0451\u0442\u043a\u0430\u044f \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u043a\u0430\u00bb, \u00ab\u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u0438\u0437\u0430\u0439\u043d, \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0430, \u0446\u0438\u0444\u0440\u043e\u0432\u0430\u044f \u0436\u0438\u0432\u043e\u043f\u0438\u0441\u044c\u00bb:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">start = time.time() images = model.text_to_image(     \"A mysterious dark stranger visits the great pyramids of egypt, \"     \"high quality, highly detailed, elegant, sharp focus, \"     \"concept art, character concepts, digital painting\",     batch_size=3, ) end = time.time() benchmark_result.append([\"XLA + Mixed Precision\", end - start]) plot_images(images)  print(f\"XLA + mixed precision: {(end - start):.2f} seconds\")<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">25\/25 [==============================] - 4s 158ms\/step XLA + mixed precision: 4.25 seconds<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/544\/297\/fa0\/544297fa0f9ed573e5d2ad1c9f36b863.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/544\/297\/fa0\/544297fa0f9ed573e5d2ad1c9f36b863.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041e\u0446\u0435\u043d\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">print(\"{:&lt;20} {:&lt;20}\".format(\"Model\", \"Runtime\")) for result in benchmark_result:     name, runtime = result     print(\"{:&lt;20} {:&lt;20}\".format(name, runtime))<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">Model                 Runtime              Standard              8.17177152633667     Mixed Precision       6.022329568862915    XLA                   6.265935659408569    XLA + Mixed Precision 4.252242088317871   <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0445\u0432\u0430\u0442\u0438\u043b\u043e \u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u0441\u0435\u043a\u0443\u043d\u0434, \u0447\u0442\u043e\u0431\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0438 \u043d\u043e\u0432\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 A100.<\/p>\n<p>  <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f XLA KerasCV \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c Stable Diffusion \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u044f. \u0410 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0438 XLA \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0430\u043c\u044b\u0439 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 Stable Diffusion \u043d\u0430 \u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044c 2022 \u0433\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043a\u043e\u043d\u0446\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432 \u043f\u043e keras.io \u043c\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043c \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u044b \u043b\u0438\u0448\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u043f\u0440\u0438\u0437\u044b\u0432\u043e\u043c:<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0433\u043e\u043d\u0438\u0442\u0435 \u0441\u0432\u043e\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u0443 \u043c\u043e\u0434\u0435\u043b\u044c! \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u043e\u043c\u0431\u0430!<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043e\u0442 NVIDIA GPU \u0438\u043b\u0438 \u0436\u0435 M1 MacBookPro, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043d\u0430 \u0441\u0432\u043e\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u0435. (\u041e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043d\u0430 M1 MacBookPro \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e: \u044d\u043f\u043f\u043b\u043e\u0432\u0441\u043a\u0438\u0439 Metal \u043f\u043e\u043a\u0430 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0435\u0451).<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/colab.research.google.com\/github\/keras-team\/keras-io\/blob\/master\/guides\/ipynb\/keras_cv\/generate_images_with_stable_diffusion.ipynb\"><strong>Colab<\/strong><\/a><\/li>\n<li><a href=\"https:\/\/github.com\/keras-team\/keras-io\/blob\/master\/guides\/keras_cv\/generate_images_with_stable_diffusion.py\"><strong>GitHub<\/strong><\/a><\/li>\n<\/ul>\n<p>  \u041d\u0430\u0443\u0447\u0438\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u0435\u0442\u0438, \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0432\u044b \u043f\u0440\u043e\u043a\u0430\u0447\u0430\u043b\u0438 \u043a\u0430\u0440\u044c\u0435\u0440\u0443 \u0438\u043b\u0438 \u0441\u0442\u0430\u043b\u0438 \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u044b\u043c IT-\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u043c:<\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/data-analyst-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=analytics_dapr_141022&amp;utm_term=conc\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Analyst (12 \u043c\u0435\u0441\u044f\u0446\u0435\u0432)<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_141022&amp;utm_term=conc\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Scientist (24\u00a0\u043c\u0435\u0441\u044f\u0446\u0430)<\/a><\/li>\n<\/ul>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u043a\u0443\u0440\u0441\u044b, \u043a\u043b\u0438\u043a\u043d\u0438\u0442\u0435 \u043f\u043e\u00a0\u0431\u0430\u043d\u043d\u0435\u0440\u0443:<\/p>\n<p>  <a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_141022&amp;utm_term=banner\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/cq\/na\/88\/cqna880todtt287i6ffb12uzzwk.png\" data-src=\"https:\/\/habrastorage.org\/webt\/cq\/na\/88\/cqna880todtt287i6ffb12uzzwk.png\"\/><\/a><\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043a\u0443\u0440\u0441\u043e\u0432<\/b>                         <\/p>\n<div class=\"spoiler_text\"><strong>Data Science \u0438\u00a0Machine Learning<\/strong>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_141022&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Scientist<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/data-analyst-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=analytics_dapr_141022&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Analyst<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/matematika-dlya-data-science#syllabus?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mat_141022&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0434\u043b\u044f Data Science\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/matematika-i-machine-learning-dlya-data-science?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_matml_141022&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0438\u00a0Machine Learning \u0434\u043b\u044f Data Science\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/data-engineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dea_141022&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e\u00a0Data Engineering<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/machine-learning-i-deep-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mldl_141022&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abMachine Learning \u0438\u00a0Deep Learning\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/machine-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_ml_141022&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e\u00a0Machine Learning<\/a><\/li>\n<\/ul>\n<p>  <strong>Python, <nobr>\u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/nobr><\/strong>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fpw_141022&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f <nobr>Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/nobr> \u043d\u0430\u00a0Python<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/python-for-web-developers?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_pws_141022&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abPython \u0434\u043b\u044f <nobr>\u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/nobr>\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/frontend-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fr_141022&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f <nobr>Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/nobr><\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/webdev?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_webdev_141022&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f <nobr>\u0412\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/nobr><\/a><\/li>\n<\/ul>\n<p>  <strong>\u041c\u043e\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/ios-razrabotchik-s-nulya?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_ios_141022&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f <nobr>iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/nobr><\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/android-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_andr_141022&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f <nobr>Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/nobr><\/a><\/li>\n<\/ul>\n<p>  <strong>Java \u0438\u00a0C#<\/strong>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/java-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_java_141022&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f <nobr>Java-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/nobr><\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/java-qa-engineer-testirovshik-po?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_qaja_141022&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f <nobr>QA-\u0438\u043d\u0436\u0435\u043d\u0435\u0440<\/nobr> \u043d\u0430\u00a0JAVA<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/c-sharp-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cdev_141022&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C#-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/game-razrabotchik-na-unity-i-c-sharp?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_gamedev_141022&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440 \u043d\u0430\u00a0Unity<\/a><\/li>\n<\/ul>\n<p>  <strong>\u041e\u0442\u00a0\u043e\u0441\u043d\u043e\u0432\u00a0\u2014 \u0432\u00a0\u0433\u043b\u0443\u0431\u0438\u043d\u0443<\/strong>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/algoritmy-i-struktury-dannyh?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_algo_141022&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438\u00a0\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_141022&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f <nobr>C++<\/nobr> \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/cyber-security-etichnij-haker?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_hacker_141022&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u00ab\u0411\u0435\u043b\u044b\u0439 \u0445\u0430\u043a\u0435\u0440\u00bb<\/a><\/li>\n<\/ul>\n<p>  <strong>\u0410\u00a0\u0442\u0430\u043a\u0436\u0435<\/strong>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/devops-ingineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_devops_141022&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e\u00a0DevOps<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_141022&amp;utm_term=cat\">\u0412\u0441\u0435 \u043a\u0443\u0440\u0441\u044b<\/a><\/li>\n<\/ul>\n<p>  <\/div>\n<\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/693322\/\"> https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/693322\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/693322\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/544\/297\/fa0\/544297fa0f9ed573e5d2ad1c9f36b863.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/544\/297\/fa0\/544297fa0f9ed573e5d2ad1c9f36b863.png\"\/><\/a><\/p>\n<p>  <\/p>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 KerasCV, <a href=\"https:\/\/stability.ai\/\">stability.ai<\/a> \u0438 <a href=\"https:\/\/github.com\/CompVis\/stable-diffusion\">Stable Diffusion<\/a>. \u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d \u043a \u0441\u0442\u0430\u0440\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e <u><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_141022&amp;utm_term=lead\">\u0444\u043b\u0430\u0433\u043c\u0430\u043d\u0441\u043a\u043e\u0433\u043e \u043a\u0443\u0440\u0441\u0430 \u043f\u043e Data Science<\/a><\/u>.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-339746","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/339746","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=339746"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/339746\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=339746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=339746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=339746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}