> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developer.ideogram.ai/v1/tutorials/custom-model-training/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.ideogram.ai/_mcp/server. > Train a custom Ideogram model on your own images using datasets, then generate with your custom model URI. # Custom Model Training Train a custom model on your own images, then use it to generate new images in your unique style. ## Overview Custom model training lets you fine-tune an Ideogram model on your own dataset of images. Once training completes, you can use the model with the **Generate** endpoint by passing its `custom_model_uri`. The workflow has four steps: 1. **Create a dataset** to hold your training images. 2. **Upload images** (and optional captions) to the dataset. 3. **Start training** to kick off the model training job. 4. **Generate images** using your trained model. ## Step 1: Create a Dataset #### Python ```python import requests response = requests.post( "https://api.ideogram.ai/datasets", headers={"Api-Key": ""}, json={"name": "My Training Dataset"} ) dataset = response.json() dataset_id = dataset["dataset_id"] print(f"Created dataset: {dataset_id}") ``` #### cURL ```bash curl -X POST https://api.ideogram.ai/datasets \ -H "Api-Key: " \ -H "Content-Type: application/json" \ -d '{"name": "My Training Dataset"}' ``` ## Step 2: Upload Training Images Upload your training images to the dataset. You can upload individual images (JPEG, PNG, WebP), optional `.txt` caption sidecar files, or ZIP archives containing both. * A dataset needs **at least 10 images** to start training. * A dataset can hold **up to 100 images**. * Caption files are matched by filename stem (e.g. `sunset.txt` captions `sunset.jpg`). #### Python ```python import requests import glob # Upload individual images files = [("files", open(f, "rb")) for f in glob.glob("training_images/*.jpg")] response = requests.post( f"https://api.ideogram.ai/datasets/{dataset_id}/upload_assets", headers={"Api-Key": ""}, files=files ) result = response.json() print(f"Uploaded {result['success_count']}/{result['total_count']} images") ``` #### cURL ```bash curl -X POST https://api.ideogram.ai/datasets//upload_assets \ -H "Api-Key: " \ -H "Content-Type: multipart/form-data" \ -F files=@image1.jpg \ -F files=@image2.jpg \ -F files=@image3.jpg ``` > **Info** > > You can also upload a ZIP file containing images and captions together, which is convenient for larger datasets. ## Step 3: Train the Model Once your dataset has enough images, start training by giving your model a name. #### Python ```python import requests response = requests.post( "https://api.ideogram.ai/v1/ideogram-v3/train-model", headers={"Api-Key": ""}, json={"dataset_id": dataset_id, "model_name": "my-custom-model"} ) training = response.json() model_id = training["model_id"] print(f"Training started: {training['training_status']}") ``` #### cURL ```bash curl -X POST https://api.ideogram.ai/v1/ideogram-v3/train-model \ -H "Api-Key: " \ -H "Content-Type: application/json" \ -d '{"dataset_id": "", "model_name": "my-custom-model"}' ``` ## Checking Training Status Poll the model details endpoint to check when training completes. #### Python ```python import requests import time while True: response = requests.get( f"https://api.ideogram.ai/models/{model_id}", headers={"Api-Key": ""} ) model = response.json()["model"] print(f"Status: {model['status']}") if model["status"] == "COMPLETED": print(f"Model ready! URI: {model.get('custom_model_uri')}") break elif model["status"] == "ERRORED": print("Training failed.") break time.sleep(60) ``` #### cURL ```bash curl -X GET https://api.ideogram.ai/models/ \ -H "Api-Key: " ``` ## Step 4: Generate with Your Model Once training is complete and `is_available_for_generation` is `true`, use the `custom_model_uri` from the model details to generate images. #### Python ```python import requests response = requests.post( "https://api.ideogram.ai/v1/ideogram-v3/generate", headers={"Api-Key": ""}, files={ "prompt": (None, "A photo in my custom style"), "custom_model_uri": (None, "model/my-custom-model/version/1"), "rendering_speed": (None, "DEFAULT") } ) result = response.json() if response.status_code == 200: print(result["data"][0]["url"]) ``` #### cURL ```bash curl -X POST https://api.ideogram.ai/v1/ideogram-v3/generate \ -H "Api-Key: " \ -H "Content-Type: multipart/form-data" \ -F prompt="A photo in my custom style" \ -F custom_model_uri="model/my-custom-model/version/1" \ -F rendering_speed="DEFAULT" ``` ## Tips for Better Results * **Use high-quality images** that clearly represent the style or subject you want the model to learn. * **Add captions** to guide the model on what each image represents. Captions are optional! * **Use consistent subjects** across your training images for best results with style transfer. > Train a custom Ideogram model on your own images using datasets, then generate with your custom model URI.