From a26bc1b4d8799b9abbd57b26a72dfdd3e334c85a Mon Sep 17 00:00:00 2001 From: Sayak Paul Date: Fri, 17 Nov 2023 18:14:02 +0530 Subject: [PATCH] [Docs] add: japanese sdxl as a reference (#5844) add: japanese sdxl as a reference --- .../custom_pipeline_overview.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/source/en/using-diffusers/custom_pipeline_overview.md b/docs/source/en/using-diffusers/custom_pipeline_overview.md index f898bd0dc2052..0f842c1b5b500 100644 --- a/docs/source/en/using-diffusers/custom_pipeline_overview.md +++ b/docs/source/en/using-diffusers/custom_pipeline_overview.md @@ -165,4 +165,25 @@ video_frames = pipeline( guidance_scale=9.0, output_type="pt" ).frames +``` + +As an additional reference example, you can refer to the repository structure of [stabilityai/japanese-stable-diffusion-xl](https://huggingface.co/stabilityai/japanese-stable-diffusion-xl/), that makes use of the `trust_remote_code` feature: + +```python + +from diffusers import DiffusionPipeline +import torch + +pipeline = DiffusionPipeline.from_pretrained( + "stabilityai/japanese-stable-diffusion-xl", trust_remote_code=True +) +pipeline.to("cuda") + +# if using torch < 2.0 +# pipeline.enable_xformers_memory_efficient_attention() + +prompt = "柴犬、カラフルアート" + +image = pipeline(prompt=prompt).images[0] + ``` \ No newline at end of file