Skip to content

Commit 802651e

Browse files
committed
update
1 parent 907ecf7 commit 802651e

3 files changed

Lines changed: 14 additions & 18 deletions

File tree

docs/source/en/api/pipelines/chroma.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Chroma can use all the same optimizations as Flux.
2929

3030
## Inference
3131

32-
The Diffusers version of Chroma is based on the `unlocked-v37` version of the original model, which is available in the [Chroma repository](https://huggingface.co/lodestones/Chroma).
32+
The Diffusers version of Chroma is based on the [`unlocked-v37`](https://huggingface.co/lodestones/Chroma/blob/main/chroma-unlocked-v37.safetensors) version of the original model, which is available in the [Chroma repository](https://huggingface.co/lodestones/Chroma).
3333

3434
```python
3535
import torch

src/diffusers/pipelines/chroma/pipeline_chroma.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,21 @@
5252
>>> import torch
5353
>>> from diffusers import ChromaPipeline
5454
55+
>>> model_id = "lodestones/Chroma"
5556
>>> ckpt_path = "https://huggingface.co/lodestones/Chroma/blob/main/chroma-unlocked-v37.safetensors"
5657
>>> transformer = ChromaTransformer2DModel.from_single_file(ckpt_path, torch_dtype=torch.bfloat16)
57-
>>> text_encoder = AutoModel.from_pretrained("black-forest-labs/FLUX.1-schnell", subfolder="text_encoder_2")
58-
>>> tokenizer = AutoTokenizer.from_pretrained("black-forest-labs/FLUX.1-schnell", subfolder="tokenizer_2")
59-
>>> pipe = ChromaImg2ImgPipeline.from_pretrained(
60-
... "black-forest-labs/FLUX.1-schnell",
58+
>>> pipe = ChromaPipeline.from_pretrained(
59+
... model_id,
6160
... transformer=transformer,
62-
... text_encoder=text_encoder,
63-
... tokenizer=tokenizer,
6461
... torch_dtype=torch.bfloat16,
6562
... )
6663
>>> pipe.enable_model_cpu_offload()
67-
>>> prompt = "A cat holding a sign that says hello world"
68-
>>> negative_prompt = "low quality, ugly, unfinished, out of focus, deformed, disfigure, blurry, smudged, restricted palette, flat colors"
64+
>>> prompt = [
65+
... "A high-fashion close-up portrait of a blonde woman in clear sunglasses. The image uses a bold teal and red color split for dramatic lighting. The background is a simple teal-green. The photo is sharp and well-composed, and is designed for viewing with anaglyph 3D glasses for optimal effect. It looks professionally done."
66+
... ]
67+
>>> negative_prompt = [
68+
... "low quality, ugly, unfinished, out of focus, deformed, disfigure, blurry, smudged, restricted palette, flat colors"
69+
... ]
6970
>>> image = pipe(prompt, negative_prompt=negative_prompt).images[0]
7071
>>> image.save("chroma.png")
7172
```

src/diffusers/pipelines/chroma/pipeline_chroma_img2img.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,26 +51,21 @@
5151
```py
5252
>>> import torch
5353
>>> from diffusers import ChromaTransformer2DModel, ChromaImg2ImgPipeline
54-
>>> from transformers import AutoModel, Autotokenizer
5554
55+
>>> model_id = "lodestones/Chroma"
5656
>>> ckpt_path = "https://huggingface.co/lodestones/Chroma/blob/main/chroma-unlocked-v37.safetensors"
57-
>>> transformer = ChromaTransformer2DModel.from_single_file(ckpt_path, torch_dtype=torch.bfloat16)
58-
>>> text_encoder = AutoModel.from_pretrained("black-forest-labs/FLUX.1-schnell", subfolder="text_encoder_2")
59-
>>> tokenizer = AutoTokenizer.from_pretrained("black-forest-labs/FLUX.1-schnell", subfolder="tokenizer_2")
6057
>>> pipe = ChromaImg2ImgPipeline.from_pretrained(
61-
... "black-forest-labs/FLUX.1-schnell",
58+
... model_id,
6259
... transformer=transformer,
63-
... text_encoder=text_encoder,
64-
... tokenizer=tokenizer,
6560
... torch_dtype=torch.bfloat16,
6661
... )
6762
>>> pipe.enable_model_cpu_offload()
68-
>>> image = load_image(
63+
>>> init_image = load_image(
6964
... "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
7065
... )
7166
>>> prompt = "a scenic fastasy landscape with a river and mountains in the background, vibrant colors, detailed, high resolution"
7267
>>> negative_prompt = "low quality, ugly, unfinished, out of focus, deformed, disfigure, blurry, smudged, restricted palette, flat colors"
73-
>>> image = pipe(prompt, image=image, negative_prompt=negative_prompt).images[0]
68+
>>> image = pipe(prompt, image=init_image, negative_prompt=negative_prompt).images[0]
7469
>>> image.save("chroma-img2img.png")
7570
```
7671
"""

0 commit comments

Comments
 (0)