From c4c0969bb900f87a3ffc3d7ddf346fe575e6124a Mon Sep 17 00:00:00 2001 From: Hongyu Chiu <20734616+james77777778@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:44:09 +0800 Subject: [PATCH] Use `image_shape` for SD3 --- .../ipynb/keras_hub/stable_diffusion_3_in_keras_hub.ipynb | 6 +++--- guides/keras_hub/stable_diffusion_3_in_keras_hub.py | 6 +++--- guides/md/keras_hub/stable_diffusion_3_in_keras_hub.md | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/guides/ipynb/keras_hub/stable_diffusion_3_in_keras_hub.ipynb b/guides/ipynb/keras_hub/stable_diffusion_3_in_keras_hub.ipynb index e1d6534b19..f07a157f63 100644 --- a/guides/ipynb/keras_hub/stable_diffusion_3_in_keras_hub.ipynb +++ b/guides/ipynb/keras_hub/stable_diffusion_3_in_keras_hub.ipynb @@ -10,7 +10,7 @@ "\n", "**Author:** [Hongyu Chiu](https://github.com/james77777778), [fchollet](https://twitter.com/fchollet), [lukewood](https://twitter.com/luke_wood_ml), [divamgupta](https://github.com/divamgupta)
\n", "**Date created:** 2024/10/09
\n", - "**Last modified:** 2024/10/09
\n", + "**Last modified:** 2024/10/24
\n", "**Description:** Image generation using KerasHub's Stable Diffusion 3 model." ] }, @@ -96,7 +96,7 @@ "That will automatically load and configure trained `backbone` and `preprocessor`\n", "for you.\n", "\n", - "Note that in this guide, we'll use `height=512` and `width=512` for faster\n", + "Note that in this guide, we'll use `image_shape=(512, 512, 3)` for faster\n", "image generation. For higher-quality output, it's recommended to use the default\n", "size of `1024`. Since the entire backbone has about 3 billion parameters, which\n", "can be challenging to fit into a consumer-level GPU, we set `dtype=\"float16\"` to\n", @@ -148,7 +148,7 @@ "\n", "\n", "backbone = keras_hub.models.StableDiffusion3Backbone.from_preset(\n", - " \"stable_diffusion_3_medium\", height=512, width=512, dtype=\"float16\"\n", + " \"stable_diffusion_3_medium\", image_shape=(512, 512, 3), dtype=\"float16\"\n", ")\n", "preprocessor = keras_hub.models.StableDiffusion3TextToImagePreprocessor.from_preset(\n", " \"stable_diffusion_3_medium\"\n", diff --git a/guides/keras_hub/stable_diffusion_3_in_keras_hub.py b/guides/keras_hub/stable_diffusion_3_in_keras_hub.py index ad0a9bc4bd..acb75d4346 100644 --- a/guides/keras_hub/stable_diffusion_3_in_keras_hub.py +++ b/guides/keras_hub/stable_diffusion_3_in_keras_hub.py @@ -2,7 +2,7 @@ Title: Stable Diffusion 3 in KerasHub! Author: [Hongyu Chiu](https://github.com/james77777778), [fchollet](https://twitter.com/fchollet), [lukewood](https://twitter.com/luke_wood_ml), [divamgupta](https://github.com/divamgupta) Date created: 2024/10/09 -Last modified: 2024/10/09 +Last modified: 2024/10/24 Description: Image generation using KerasHub's Stable Diffusion 3 model. Accelerator: GPU """ @@ -63,7 +63,7 @@ That will automatically load and configure trained `backbone` and `preprocessor` for you. -Note that in this guide, we'll use `height=512` and `width=512` for faster +Note that in this guide, we'll use `image_shape=(512, 512, 3)` for faster image generation. For higher-quality output, it's recommended to use the default size of `1024`. Since the entire backbone has about 3 billion parameters, which can be challenging to fit into a consumer-level GPU, we set `dtype="float16"` to @@ -107,7 +107,7 @@ def display_generated_images(images): backbone = keras_hub.models.StableDiffusion3Backbone.from_preset( - "stable_diffusion_3_medium", height=512, width=512, dtype="float16" + "stable_diffusion_3_medium", image_shape=(512, 512, 3), dtype="float16" ) preprocessor = keras_hub.models.StableDiffusion3TextToImagePreprocessor.from_preset( "stable_diffusion_3_medium" diff --git a/guides/md/keras_hub/stable_diffusion_3_in_keras_hub.md b/guides/md/keras_hub/stable_diffusion_3_in_keras_hub.md index 9c7b93704b..5770ebbdec 100644 --- a/guides/md/keras_hub/stable_diffusion_3_in_keras_hub.md +++ b/guides/md/keras_hub/stable_diffusion_3_in_keras_hub.md @@ -2,7 +2,7 @@ **Author:** [Hongyu Chiu](https://github.com/james77777778), [fchollet](https://twitter.com/fchollet), [lukewood](https://twitter.com/luke_wood_ml), [divamgupta](https://github.com/divamgupta)
**Date created:** 2024/10/09
-**Last modified:** 2024/10/09
+**Last modified:** 2024/10/24
**Description:** Image generation using KerasHub's Stable Diffusion 3 model. @@ -71,7 +71,7 @@ text_to_image = keras_hub.models.StableDiffusion3TextToImage.from_preset( That will automatically load and configure trained `backbone` and `preprocessor` for you. -Note that in this guide, we'll use `height=512` and `width=512` for faster +Note that in this guide, we'll use `image_shape=(512, 512, 3)` for faster image generation. For higher-quality output, it's recommended to use the default size of `1024`. Since the entire backbone has about 3 billion parameters, which can be challenging to fit into a consumer-level GPU, we set `dtype="float16"` to @@ -116,7 +116,7 @@ def display_generated_images(images): backbone = keras_hub.models.StableDiffusion3Backbone.from_preset( - "stable_diffusion_3_medium", height=512, width=512, dtype="float16" + "stable_diffusion_3_medium", image_shape=(512, 512, 3), dtype="float16" ) preprocessor = keras_hub.models.StableDiffusion3TextToImagePreprocessor.from_preset( "stable_diffusion_3_medium"