Instructions to use diffusers-internal-dev/ideogram-character-generator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use diffusers-internal-dev/ideogram-character-generator with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("diffusers-internal-dev/ideogram-character-generator", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
| library_name: diffusers | |
| ## How to use | |
| #### use ideogram-api to generate character using one input image | |
| Get your Ideogram API token from [here](https://developer.ideogram.ai/ideogram-api/api-overview) | |
| Set it as the `IDEOGRAM_API_KEY` environment variable: | |
| ```py | |
| from diffusers import ModularPipeline | |
| from diffusers.utils import load_image | |
| character_pipe = ModularPipeline.from_pretrained("diffusers-internal-dev/ideogram-character-generator", trust_remote_code=True) | |
| print(character_pipe.doc) | |
| image = character_pipe( | |
| prompt=( | |
| '''Youtube thumbnail of a women texting on iphone. Graphic overlay of text bubble "🤗"''' | |
| ), | |
| character_image=load_image(PATH_TO_IMAGE), | |
| output="image" | |
| ) | |
| image.save("yiyi_character.png") | |
| ``` | |
| #### use with Flux Kontext | |
| ``` | |
| from diffusers import FluxKontextPipeline | |
| import torch | |
| pipe = FluxKontextPipeline.from_pretrained("black-forest-labs/FLUX.1-Kontext-dev", torch_dtype=torch.bfloat16) | |
| pipe.to("cuda") | |
| image = pipe( | |
| image=image, | |
| prompt='''change the text to "when is next diffusers release?"''', | |
| guidance_scale=1.5 | |
| ).images[0] | |
| ``` | |
|  | |