|
52 | 52 | >>> import torch |
53 | 53 | >>> from diffusers import ChromaPipeline |
54 | 54 |
|
| 55 | + >>> model_id = "lodestones/Chroma" |
55 | 56 | >>> ckpt_path = "https://huggingface.co/lodestones/Chroma/blob/main/chroma-unlocked-v37.safetensors" |
56 | 57 | >>> 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, |
61 | 60 | ... transformer=transformer, |
62 | | - ... text_encoder=text_encoder, |
63 | | - ... tokenizer=tokenizer, |
64 | 61 | ... torch_dtype=torch.bfloat16, |
65 | 62 | ... ) |
66 | 63 | >>> 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 | + ... ] |
69 | 70 | >>> image = pipe(prompt, negative_prompt=negative_prompt).images[0] |
70 | 71 | >>> image.save("chroma.png") |
71 | 72 | ``` |
|
0 commit comments