Skip to content

Commit 7ad6865

Browse files
committed
Update usage example
1 parent 56992d1 commit 7ad6865

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

examples/research_projects/anytext/pipeline_anytext.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,10 @@
7575
>>> import torch
7676
7777
>>> # load control net and stable diffusion v1-5
78-
>>> text_controlnet = TextControlNetModel.from_pretrained("a/TextControlNet", torch_dtype=torch.float16)
79-
>>> pipe = AnyTextPipeline.from_pretrained(
80-
... "a/AnyText", controlnet=text_controlnet, torch_dtype=torch.float16,
81-
... variant="fp16"
82-
... ).to("cuda")
78+
>>> text_controlnet = TextControlNetModel.from_pretrained("tolgacangoz/anytext-controlnet", torch_dtype=torch.float16)
79+
>>> pipe = DiffusionPipeline.from_pretrained("tolgacangoz/anytext", controlnet=text_controlnet,
80+
... torch_dtype=torch.float16, variant="fp16",
81+
... ).to("cuda")
8382
8483
>>> pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
8584
>>> # uncomment following line if PyTorch>=2.0 is not installed for memory optimization
@@ -93,10 +92,9 @@
9392
>>> generator = torch.Generator("cpu").manual_seed(66273235)
9493
>>> prompt = 'photo of caramel macchiato coffee on the table, top-down perspective, with "Any" "Text" written on it using cream'
9594
>>> draw_pos = load_image("www.huggingface.co/a/AnyText/tree/main/examples/gen9.png")
96-
>>> image = pipe(
97-
... prompt, num_inference_steps=20, generator=generator, mode="generate",
98-
... draw_pos=draw_pos
99-
... ).images[0]
95+
>>> image = pipe(prompt, num_inference_steps=20, generator=generator, mode="generate",
96+
... draw_pos=draw_pos,
97+
... ).images[0]
10098
>>> image
10199
```
102100
"""

0 commit comments

Comments
 (0)