".github/git@developer.sourcefind.cn:OpenDAS/torchaudio.git" did not exist on "8e0c2a3bab2c09c1d489377b66c1dfbf4c79498d"
Unverified Commit 7ef8a465 authored by Tolga Cangöz's avatar Tolga Cangöz Committed by GitHub
Browse files

[`Docs`] Fix CPU offloading usage (#9207)

* chore: Fix cpu offloading usage

* Trim trailing white space

* docs: update Kolors model link in kolors.md
parent f848feba
...@@ -14,7 +14,7 @@ specific language governing permissions and limitations under the License. ...@@ -14,7 +14,7 @@ specific language governing permissions and limitations under the License.
![](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/kolors/kolors_header_collage.png) ![](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/kolors/kolors_header_collage.png)
Kolors is a large-scale text-to-image generation model based on latent diffusion, developed by [the Kuaishou Kolors team](kwai-kolors@kuaishou.com). Trained on billions of text-image pairs, Kolors exhibits significant advantages over both open-source and closed-source models in visual quality, complex semantic accuracy, and text rendering for both Chinese and English characters. Furthermore, Kolors supports both Chinese and English inputs, demonstrating strong performance in understanding and generating Chinese-specific content. For more details, please refer to this [technical report](https://github.com/Kwai-Kolors/Kolors/blob/master/imgs/Kolors_paper.pdf). Kolors is a large-scale text-to-image generation model based on latent diffusion, developed by [the Kuaishou Kolors team](https://github.com/Kwai-Kolors/Kolors). Trained on billions of text-image pairs, Kolors exhibits significant advantages over both open-source and closed-source models in visual quality, complex semantic accuracy, and text rendering for both Chinese and English characters. Furthermore, Kolors supports both Chinese and English inputs, demonstrating strong performance in understanding and generating Chinese-specific content. For more details, please refer to this [technical report](https://github.com/Kwai-Kolors/Kolors/blob/master/imgs/Kolors_paper.pdf).
The abstract from the technical report is: The abstract from the technical report is:
...@@ -74,7 +74,7 @@ image_encoder = CLIPVisionModelWithProjection.from_pretrained( ...@@ -74,7 +74,7 @@ image_encoder = CLIPVisionModelWithProjection.from_pretrained(
pipe = KolorsPipeline.from_pretrained( pipe = KolorsPipeline.from_pretrained(
"Kwai-Kolors/Kolors-diffusers", image_encoder=image_encoder, torch_dtype=torch.float16, variant="fp16" "Kwai-Kolors/Kolors-diffusers", image_encoder=image_encoder, torch_dtype=torch.float16, variant="fp16"
).to("cuda") )
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config, use_karras_sigmas=True) pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config, use_karras_sigmas=True)
pipe.load_ip_adapter( pipe.load_ip_adapter(
......
...@@ -56,7 +56,7 @@ EXAMPLE_DOC_STRING = """ ...@@ -56,7 +56,7 @@ EXAMPLE_DOC_STRING = """
>>> from diffusers.utils import export_to_gif >>> from diffusers.utils import export_to_gif
>>> # You can replace the checkpoint id with "maxin-cn/Latte-1" too. >>> # You can replace the checkpoint id with "maxin-cn/Latte-1" too.
>>> pipe = LattePipeline.from_pretrained("maxin-cn/Latte-1", torch_dtype=torch.float16).to("cuda") >>> pipe = LattePipeline.from_pretrained("maxin-cn/Latte-1", torch_dtype=torch.float16)
>>> # Enable memory optimizations. >>> # Enable memory optimizations.
>>> pipe.enable_model_cpu_offload() >>> pipe.enable_model_cpu_offload()
......
...@@ -54,7 +54,7 @@ EXAMPLE_DOC_STRING = """ ...@@ -54,7 +54,7 @@ EXAMPLE_DOC_STRING = """
>>> pipe = LuminaText2ImgPipeline.from_pretrained( >>> pipe = LuminaText2ImgPipeline.from_pretrained(
... "Alpha-VLLM/Lumina-Next-SFT-diffusers", torch_dtype=torch.bfloat16 ... "Alpha-VLLM/Lumina-Next-SFT-diffusers", torch_dtype=torch.bfloat16
... ).cuda() ... )
>>> # Enable memory optimizations. >>> # Enable memory optimizations.
>>> pipe.enable_model_cpu_offload() >>> pipe.enable_model_cpu_offload()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment