> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aihubmix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Dibujo con Ideogram AI

## Interfaz de Ideogram V3

El modelo Ideogram V3 ofrece capacidades avanzadas de generación y procesamiento de imágenes. La interfaz V3 se diferencia de las versiones anteriores en parámetros y uso. Esta sección detallará las interfaces V3 y los ejemplos de uso.

### V3 Generate

`POST` [https://aihubmix.com/ideogram/v1/ideogram-v3/generate](https://aihubmix.com/ideogram/v1/ideogram-v3/generate)

Genera imágenes basadas en los prompts dados. El modelo V3 ofrece capacidades de generación de imágenes de mayor calidad, admitiendo estilos más diversos y controles de parámetros.

<ParamField body="prompt" type="string" required>
  Prompt para la generación de la imagen
</ParamField>

<ParamField body="rendering_speed" default="DEFAULT" type="string">
  Opciones de velocidad de renderizado, disponibles `TURBO`, `DEFAULT`, `QUALITY`
</ParamField>

<ParamField body="num_images" default="1" type="integer">
  Número de imágenes a generar, rango 1-8\
  Generar más imágenes no aumentará significativamente el tiempo de generación
</ParamField>

<ParamField body="aspect_ratio" default="1x1" type="string">
  Relación de aspecto para la generación de la imagen; admite una amplia variedad de especificaciones\
  Disponibles \['1x3', '3x1', '1x2', '2x1', '9x16', '16x9', '10x16', '16x10', '2x3', '3x2', '3x4', '4x3', '4x5', '5x4', '1x1']\
  Las relaciones de aspecto utilizadas en distintos modelos son diferentes.
</ParamField>

<ParamField body="magic_prompt" default="AUTO" type="string">
  Mejora del prompt. Parámetros disponibles: `AUTO`, `ON`, `OFF`
</ParamField>

<ParamField body="style_type" default="AUTO" type="string">
  Tipo de estilo para la generación de imágenes, disponibles `AUTO`, `GENERAL`, `REALISTIC`, `DESIGN`\
  Nota: Comparado con la versión V2, el tipo está más enfocado
</ParamField>

<ParamField body="negative_prompt" type="string">
  Descripción del contenido que no quieres que aparezca en la imagen
</ParamField>

<ParamField body="seed" type="integer">
  Semilla aleatoria, rango: 0-2147483647\
  No utilices semilla al generar varias imágenes; de lo contrario, se generarán la misma imagen
</ParamField>

<ParamField body="style_reference_images" type="file">
  Imagen de referencia de estilo; puede usarse como guía estilística
</ParamField>

### Ejemplos de uso

<CodeGroup>
  ```shell Curl Text-to-Image theme={null}
  curl -X POST https://aihubmix.com/ideogram/v1/ideogram-v3/generate \
    -H "Api-Key: sk-***" \
    -H "Content-Type: multipart/form-data" \
    -F prompt="Delicate 3D cover design with various combat machines flying from an portal. The machines have different shapes, sizes, and colors. The portal is emitting swirling energy. The background contains a futuristic city with tall buildings. The text \"One Gateway, Infinite Models\" is placed in the center with neon lights, expansive view, cinematic lighting, vivid color, bright tone. clean text, cyber punk, smooth render" \
    -F rendering_speed="QUALITY" \
    -F num_images="2" \
    -F aspect_ratio="2x1"
  ```

  ```py Python Text-to-Image theme={null}
  import requests
  import os

  # Prepare request data - use dictionary instead of JSON
  data = {
    "prompt": "Delicate 3D cover design with various combat machines flying from an portal. The machines have different shapes, sizes, and colors. The portal is emitting swirling energy. The background contains a futuristic city with tall buildings. The text \"One Gateway, Infinite Models\" is placed in the center with neon lights, expansive view, cinematic lighting, vivid color, bright tone. clean text, cyber punk, smooth render",
    "rendering_speed": "QUALITY",
    "num_images": "2",
    "aspect_ratio": "2x1",
    "magic_prompt": "AUTO",
    "style_type": "AUTO",
    "negative_prompt": "blurry, watermark"
  }

  # Content-Type is multipart/form-data
  files = {}
  for key, value in data.items():
      files[key] = (None, str(value))  # Send each data field as a form field

  response = requests.post(
    "https://aihubmix.com/ideogram/v1/ideogram-v3/generate",
    headers={
      "Api-Key": "sk-***" # Replace with your AiHubMix API key
    },
    files=files
  )
  print(response.json())

  # save output image to file
  response_json = response.json()
  if response.ok and 'data' in response_json and len(response_json['data']) > 0:
      image_data = response_json['data'][0]['url']
      image_response = requests.get(image_data)
      if image_response.ok:
          with open('output.png', 'wb') as f:
              f.write(image_response.content)
          print("Image saved to output.png")
      else:
          print(f"Failed to get image: {image_response.status_code}")
  else:
      print("API request failed or no image returned")
  ```

  ```py Python Reference Image + Text-to-Image theme={null}
  import requests
  import os

  data = {
    "prompt": "Delicate 3D cover design with various combat machines flying from an portal. The machines have different shapes, sizes, and colors. The portal is emitting swirling energy. The background contains a futuristic city with tall buildings. The text \"One Gateway, Infinite Models\" is placed in the center with neon lights, expansive view, cinematic lighting, vivid color, bright tone. clean text, cyber punk, smooth render",
    "rendering_speed": "QUALITY",
    "num_images": 2,
    # "seed": "998", # DO NOT use seed when generating multiple images
    "aspect_ratio": "2x1", 
    "magic_prompt": "AUTO",
    "style_type": "AUTO",
    "negative_prompt": "blurry, watermark",
  }

  # initialize files parameter
  files = None

  # Style reference image path
  style_reference_path = "yourpath/reference-image.jpeg"
  use_reference_image = True

  if use_reference_image and os.path.exists(style_reference_path):
      # If using a reference image and the file exists, set the files parameter
      files = [
          ("style_reference_images", open(style_reference_path, "rb")),
          # If you need to add multiple style reference images, you can add them as follows:
          # ("style_reference_images", open("Second reference image path", "rb")),
      ]
  elif use_reference_image:
      print(f"Warning: Style reference image not found: {style_reference_path}")

  response = requests.post(
    "https://aihubmix.com/ideogram/v1/ideogram-v3/generate",
    headers={
      "Api-Key": "sk-***" # Replace with your AiHubMix API key
    },
    data=data,
    files=files
  )
  print(response.json())

  # save output image to file
  response_json = response.json()
  if response.ok and 'data' in response_json and len(response_json['data']) > 0:
      image_data = response_json['data'][0]['url']
      image_response = requests.get(image_data)
      if image_response.ok:
          with open('output.png', 'wb') as f:
              f.write(image_response.content)
          print("Image saved to output.png")
      else:
          print(f"Failed to get image: {image_response.status_code}")
  else:
      print("API request failed or no image returned")
  ```
</CodeGroup>

### V3 Remix

`POST` [https://aihubmix.com/ideogram/v1/ideogram-v3/remix](https://aihubmix.com/ideogram/v1/ideogram-v3/remix)

Remixea imágenes basándose en una imagen de referencia y un prompt. La función Remix de V3 mantiene mejor el estilo y el contenido de la imagen original.

<ParamField body="prompt" type="string" required>
  Prompt para el remix de la imagen
</ParamField>

<ParamField body="image" type="file" required>
  Archivo de imagen original
</ParamField>

<ParamField body="image_weight" default="50" type="integer">
  El peso de la imagen original, rango 1-100; cuanto mayor sea el valor, más parecido será el resultado a la imagen original.
</ParamField>

<ParamField body="rendering_speed" default="DEFAULT" type="string">
  Opciones de velocidad de renderizado, disponibles `TURBO`, `DEFAULT`, `QUALITY`
</ParamField>

<ParamField body="num_images" default="1" type="integer">
  Número de imágenes a generar, rango 1-8
  Generar más imágenes no aumentará significativamente el tiempo de generación
</ParamField>

<ParamField body="aspect_ratio" type="string">
  Relación de aspecto de la imagen de salida, disponibles \['1x3', '3x1', '1x2', '2x1', '9x16', '16x9', '10x16', '16x10', '2x3', '3x2', '3x4', '4x3', '4x5', '5x4', '1x1']
</ParamField>

<ParamField body="style_reference_images" type="file">
  Imagen de referencia de estilo; puede usarse como guía estilística
</ParamField>

<ParamField body="seed" type="integer">
  Semilla aleatoria, rango: 0-2147483647
</ParamField>

<ParamField body="magic_prompt" default="AUTO" type="string">
  Mejora del prompt. Parámetros disponibles: `AUTO`, `ON`, `OFF`
</ParamField>

<ParamField body="style_type" default="AUTO" type="string">
  Tipo de estilo para la generación de imágenes, disponibles `AUTO`, `GENERAL`, `REALISTIC`, `DESIGN`
</ParamField>

<ParamField body="negative_prompt" type="string">
  Descripción del contenido que no quieres que aparezca en la imagen
</ParamField>

### Ejemplos de uso

<CodeGroup>
  ```py Python Remix theme={null}
  import requests
  import os

  data = {
    "prompt": "bird playing with a cat in the snow, pixel art style",
    "image_weight": "60",
    "rendering_speed": "QUALITY",
    "num_images": 1,
    "seed": 1,
    "aspect_ratio": "16x9", 
    "magic_prompt": "AUTO",
    "style_type": "AUTO",
    "negative_prompt": "blurry, bad anatomy, watermark",
  }

  # Original image - required
  source_image_path = "yourpath/image.jpeg"
  if not os.path.exists(source_image_path):
      raise FileNotFoundError(f"Original image not found: {source_image_path}")

  # initialize files parameter
  files = None

  # Style reference image path
  style_reference_path = "yourpath/reference-image.png"
  use_reference_image = True

  # Prepare the files for upload
  with open(source_image_path, "rb") as image_file:
      if use_reference_image and os.path.exists(style_reference_path):
          # If using a reference image and the file exists, set the files parameter
          files = {
              "image": image_file,
              "style_reference_images": open(style_reference_path, "rb"),
          }
      else:
          if use_reference_image:
              print(f"Warning: Style reference image not found: {style_reference_path}")
          files = {
              "image": image_file,
          }

      response = requests.post(
        "https://aihubmix.com/ideogram/v1/ideogram-v3/remix",
        headers={
          "Api-Key": "sk-***" # Replace with your AiHubMix API key
        },
        data=data,
        files=files
      )
  print(response.json())

  # save output image to file
  response_json = response.json()
  if response.ok and 'data' in response_json and len(response_json['data']) > 0:
      image_data = response_json['data'][0]['url']
      image_response = requests.get(image_data)
      if image_response.ok:
          with open('output.png', 'wb') as f:
              f.write(image_response.content)
          print("Image saved to output.png")
      else:
          print(f"Failed to get image: {image_response.status_code}")
  else:
      print("API request failed or no image returned")
      print(f"Error details: {response_json}")
  ```
</CodeGroup>

### V3 Edit

`POST` [https://aihubmix.com/ideogram/v1/ideogram-v3/edit](https://aihubmix.com/ideogram/v1/ideogram-v3/edit)

La función de edición local de V3 permite a los usuarios editar con precisión áreas específicas de una imagen proporcionando la imagen original y una máscara, manteniendo las demás áreas sin cambios.

<ParamField body="prompt" type="string" required>
  Prompt para la edición de la imagen
</ParamField>

<ParamField body="image" type="file" required>
  Archivo de imagen original
</ParamField>

<ParamField body="mask" type="file" required>
  Imagen de máscara; el área negra representa la parte a editar y el área blanca, la parte que se mantiene sin cambios
</ParamField>

<ParamField body="rendering_speed" default="DEFAULT" type="string">
  Opciones de velocidad de renderizado, disponibles `TURBO`, `DEFAULT`, `QUALITY`
</ParamField>

<ParamField body="num_images" default="1" type="integer">
  Número de imágenes a generar, rango 1-8
  Generar más imágenes no aumentará significativamente el tiempo de generación
</ParamField>

<ParamField body="aspect_ratio" type="string">
  Relación de aspecto de la imagen de salida, disponibles \['1x3', '3x1', '1x2', '2x1', '9x16', '16x9', '10x16', '16x10', '2x3', '3x2', '3x4', '4x3', '4x5', '5x4', '1x1']
</ParamField>

<ParamField body="seed" type="integer">
  Semilla aleatoria, rango: 0-2147483647
</ParamField>

<ParamField body="magic_prompt" default="AUTO" type="string">
  Mejora del prompt. Parámetros disponibles: `AUTO`, `ON`, `OFF`
</ParamField>

<ParamField body="style_type" default="AUTO" type="string">
  Tipo de estilo para la generación de imágenes, disponibles `AUTO`, `GENERAL`, `REALISTIC`, `DESIGN`
</ParamField>

<ParamField body="negative_prompt" type="string">
  Descripción del contenido que no quieres que aparezca en la imagen
</ParamField>

### Ejemplos de uso

<CodeGroup>
  ```py Python Edit theme={null}
  import requests
  import os

  # Original image - required
  source_image_path = "yourpath/image.jpeg"
  # mask - required
  mask_image_path = "yourpath/mask.jpg"

  if not os.path.exists(source_image_path):
      raise FileNotFoundError(f"Original image not found: {source_image_path}")

  with open(source_image_path, "rb") as image_file, open(mask_image_path, "rb") as mask_file:
      response = requests.post(
          "https://aihubmix.com/ideogram/v1/ideogram-v3/edit",
          headers={
              "Api-Key": "sk-***" # Replace with your AiHubMix API key
          },
          data={
              "prompt": "remove text",
              "rendering_speed": "DEFAULT",
              "num_images": 1,
              "seed": 1,
              "aspect_ratio": "16x9",
              "magic_prompt": "AUTO",
              "style_type": "AUTO",
              "negative_prompt": "blurry, bad anatomy, watermark",
          },
          files={
              "image": image_file,
              "mask": mask_file,
          }
      )

  print(response.json())

  # save output image to file
  response_json = response.json()
  if response.ok and 'data' in response_json and len(response_json['data']) > 0:
      image_data = response_json['data'][0]['url']
      image_response = requests.get(image_data)
      if image_response.ok:
          with open('output.png', 'wb') as f:
              f.write(image_response.content)
          print("Image saved to output.png")
      else:
          print(f"Failed to get image: {image_response.status_code}")
  else:
      print("API request failed or no image returned")
      print(f"Error details: {response_json}")
  ```
</CodeGroup>

### V3 Replace Background

`POST` [https://aihubmix.com/ideogram/v1/ideogram-v3/replace-background](https://aihubmix.com/ideogram/v1/ideogram-v3/replace-background)

La función de reemplazo de fondo de V3 puede identificar de forma inteligente el primer plano y el fondo de la imagen y reemplazar el fondo según el prompt, manteniendo intactos los objetos del primer plano.

<ParamField body="prompt" type="string" required>
  Prompt para el reemplazo del fondo
</ParamField>

<ParamField body="image" type="file" required>
  Archivo de imagen original
</ParamField>

<ParamField body="rendering_speed" default="DEFAULT" type="string">
  Opciones de velocidad de renderizado, disponibles `TURBO`, `DEFAULT`, `QUALITY`
</ParamField>

<ParamField body="num_images" default="1" type="integer">
  Número de imágenes a generar, rango 1-8
  Generar más imágenes no aumentará significativamente el tiempo de generación
</ParamField>

<ParamField body="style_reference_images" type="file">
  Imagen de referencia de estilo; puede usarse como guía estilística
</ParamField>

<ParamField body="seed" type="integer">
  Semilla aleatoria, rango: 0-2147483647
</ParamField>

<ParamField body="magic_prompt" default="AUTO" type="string">
  Mejora del prompt. Parámetros disponibles: `AUTO`, `ON`, `OFF`
</ParamField>

<ParamField body="style_type" default="AUTO" type="string">
  Tipo de estilo para la generación de imágenes, disponibles `AUTO`, `GENERAL`, `REALISTIC`, `DESIGN`
</ParamField>

### Ejemplos de uso

<CodeGroup>
  ```py Python Replace Background theme={null}
  import requests
  import os

  data = {
    "prompt": "bird playing with a cat in the snow, pixel art style",
    "rendering_speed": "QUALITY",
    "num_images": 1,
    "seed": 1,
    # no "aspect_ratio"
    "magic_prompt": "AUTO",
    "style_type": "AUTO",
    # no "negative_prompt"
  }

  # Original image - required
  source_image_path = "yourpath/image.png"
  if not os.path.exists(source_image_path):
      raise FileNotFoundError(f"Original image not found: {source_image_path}")

  # initialize files parameter
  files = None

  # Style reference image path
  style_reference_path = "yourpath/reference-image.png"
  use_reference_image = True

  # Prepare files
  with open(source_image_path, "rb") as image_file:
      if use_reference_image and os.path.exists(style_reference_path):
          # If using a reference image and the file exists, set the files parameter
          files = {
              "image": image_file,
              "style_reference_images": open(style_reference_path, "rb"),
          }
      else:
          if use_reference_image:
              print(f"Warning: Style reference image not found: {style_reference_path}")
          files = {
              "image": image_file,
          }

      response = requests.post(
        "https://aihubmix.com/ideogram/v1/ideogram-v3/replace-background",
        headers={
          "Api-Key": "sk-***" # Replace with your AiHubMix API key
        },
        data=data,
        files=files
      )
  print(response.json())

  # save output image to file
  response_json = response.json()
  if response.ok and 'data' in response_json and len(response_json['data']) > 0:
      image_data = response_json['data'][0]['url']
      image_response = requests.get(image_data)
      if image_response.ok:
          with open('output.png', 'wb') as f:
              f.write(image_response.content)
          print("Image saved to output.png")
      else:
          print(f"Failed to get image: {image_response.status_code}")
  else:
      print("API request failed or no image returned")
      print(f"Error details: {response_json}")
  ```
</CodeGroup>

Para más parámetros opcionales, consulta [Ideogram AI](https://developer.ideogram.ai/api-reference/api-reference/generate-v3)

### 💰 Precios V3

| Ideogram v3 | Generate  | Remix     | Edit      | Reframe   | Replace BG |
| ----------- | --------- | --------- | --------- | --------- | ---------- |
| 3.0 Turbo   | US \$0.03 | US \$0.03 | US \$0.03 | US \$0.03 | US \$0.03  |
| 3.0 Default | US \$0.06 | US \$0.06 | US \$0.06 | US \$0.06 | US \$0.06  |
| 3.0 Quality | US \$0.09 | US \$0.09 | US \$0.09 | US \$0.09 | US \$0.09  |

***

## Descripción de las interfaces V2 y V1

Las interfaces de dibujo de Ideogram AI V2 y V1 ofrecen sólidas capacidades de texto a imagen, incluidas las funciones generate, remix, edit, upscale y describe.

* **Remix:** Crea imágenes nuevas basadas en una imagen de referencia y un prompt.
* **Edit:** Realiza ediciones locales en áreas específicas de una imagen de referencia usando prompts y máscaras.
* **Upscale:** Mejora imágenes de baja resolución a alta resolución, con control sobre la similitud y los niveles de detalle.
* **Describe:** Ingeniería inversa de prompts para describir imágenes.

**Estilos admitidos:**

* AUTO: Selección automática predeterminada
* GENERAL: Uso general
* REALISTIC: Realista
* DESIGN: Orientado a diseño
* RENDER\_3D: Renderizado 3D
* ANIME: Estilo anime

<Warning>
  1. Disponible a través de la API oficial de AiHubMix o la [aplicación Cherry Studio](https://cherry-ai.com/). Ten en cuenta que actualmente se requiere un proxy para la generación de imágenes; la conexión directa dentro de China se admitirá en el futuro.
  2. Cherry Studio actualmente solo ofrece la interfaz de dibujo (generate) de Ideogram.
</Warning>

### Generate

`POST` [https://aihubmix.com/ideogram/generate](https://api.aihubmix.com/ideogram/generate)\
Genera imágenes de forma sincrónica basadas en los prompts dados y parámetros opcionales. Los enlaces de las imágenes tienen un periodo de validez limitado; si quieres conservar las imágenes, debes descargarlas y guardarlas.

**Parámetros de la solicitud**

<ParamField body="image_request" type="object" required>
  Objeto de solicitud para la generación de la imagen
</ParamField>

<ParamField body="image_request.prompt" type="string" required>
  Prompt para la generación de la imagen
</ParamField>

<ParamField body="image_request.aspect_ratio" default="ASPECT_1_1" type="string">
  Relación de aspecto para la generación de la imagen, determina la resolución. No se puede usar junto con el parámetro resolution.

  Relaciones disponibles:

  * ASPECT\_1\_1
  * ASPECT\_3\_1
  * ASPECT\_1\_3
  * ASPECT\_3\_2
  * ASPECT\_2\_3
  * ASPECT\_4\_3
  * ASPECT\_3\_4
  * ASPECT\_16\_9
  * ASPECT\_9\_16
  * SPECT\_16\_10
  * ASPECT\_10\_16
</ParamField>

<ParamField body="image_request.model" default="V_2" type="string">
  Modelo para generar o editar imágenes. /generate y /remix admiten todos los tipos de modelo, pero /edit solo admite V\_2 y V\_2\_TURBO.

  Versiones de modelo disponibles:

  * V\_1
  * V\_1\_TURBO
  * V\_2
  * V\_2\_TURBO
  * V\_2A
  * V\_2A\_TURBO
</ParamField>

<ParamField body="image_request.magic_prompt_option" default="AUTO" type="string">
  Opción de mejora del prompt. Parámetros disponibles: AUTO, ON, OFF
</ParamField>

<ParamField body="image_request.seed" type="integer">
  Semilla aleatoria, rango: 0-2147483647
</ParamField>

<ParamField body="image_request.style_type" default="AUTO" type="string">
  Tipo de estilo utilizado para generar imágenes; este parámetro solo se aplica a las versiones V\_2 y superiores del modelo y no debe especificarse en las versiones V\_1.

  Estilos disponibles:

  * AUTO
  * GENERAL
  * REALISTIC
  * DESIGN
  * RENDER\_3D
  * ANIME
</ParamField>

<ParamField body="image_request.negative_prompt" type="string">
  Describe lo que no quieres que aparezca en la imagen. Solo se aplica a las versiones de modelo V\_1, V\_1\_TURBO, V\_2 y V\_2\_TURBO. Las descripciones en el prompt tienen prioridad sobre las descripciones en el negative prompt.
</ParamField>

<ParamField body="image_request.num_images" default="1" type="integer">
  Número de imágenes a generar, rango 1-8
</ParamField>

<ParamField body="image_request.resolution" type="string">
  Resolución para la generación de la imagen (solo aplicable a la versión 2.0 del modelo, no se puede usar junto con aspect\_ratio), expresada como ancho x alto. Si no se especifica, se usará aspect\_ratio por defecto.
</ParamField>

### Ejemplos de llamada

<CodeGroup>
  ```py Python theme={null}
  import requests
  import os

  url = "https://aihubmix.com/ideogram/generate"

  payload = { "image_request": {
          "prompt": "3D cartoon, An adorable white owl baby with tilted head, shiny amber eyes with highlight, fluffy body, standing on a trunk with moss and lots of glowing mushrooms, Close up, cinematic lighting, low angle, deep sense of depth. The background is a magical spring landscape, cute and esthetic, huge title design \"Always curious\"", #string optional
          "negative_prompt": "blurry, bad anatomy, watermark",
          "aspect_ratio": "ASPECT_3_2",  # optional include ASPECT_1_1(Default), ASPECT_3_2, ASPECT_2_3, ASPECT_4_3, ASPECT_3_4, ASPECT_16_9, ASPECT_9_16, SPECT_16_10, ASPECT_10_16
          "model": "V_2",
          "num_images": 2, #integer optional >=1 <=8 Defaults to 1
          "magic_prompt_option": "AUTO", #string optional AUTO, ON, OFF
          #"seed": "2" #integer optional >=0 <=2147483647
          "style_type": "RENDER_3D" #string optional AUTO/GENERAL/REALISTIC/DESIGN/RENDER_3D/ANIME, only applicable to V_2 and above
      } }
  headers = {
      "Api-Key": os.getenv("AIHUBMIX_API_KEY"),
      "Content-Type": "application/json"
  }

  response = requests.post(url, json=payload, headers=headers)

  print(response.json())
  ```

  ```js Javascript theme={null}
  const url = 'https://aihubmix.com/ideogram/describe';
  const form = new FormData();
  form.append('image_file', '<file1>');

  const options = {method: 'POST', headers: {'Api-Key': '<apiKey>'}};

  options.body = form;

  try {
    const response = await fetch(url, options);
    const data = await response.json();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
  ```

  ```shell Curl theme={null}
  curl -X POST https://aihubmix.com/ideogram/generate \
       -H "Api-Key: <apiKey>" \
       -H "Content-Type: application/json" \
       -d '{
    "image_request": {
      "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.",
      "aspect_ratio": "ASPECT_10_16",
      "model": "V_2",
      "magic_prompt_option": "AUTO"
    }
  }'
  ```
</CodeGroup>

### Respuesta

Imagen(es) generada(s) correctamente.

```json theme={null}
{
  "created": "2000-01-23T04:56:07Z",
  "data": [
    {
      "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.",
      "resolution": "1024x1024",
      "is_image_safe": true,
      "seed": 12345,
      "url": "https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g",
      "style_type": "REALISTIC"
    }
  ]
}
```

### Códigos de error

* `400` : Post Generate Image Request Bad Request Error
* `401` : Post Generate Image Request Unauthorized Error
* `422` : Post Generate Image Request Unprocessable Entity Error
* `429` : Post Generate Image Request Too Many Requests Error

### Edit

`POST` [https://aihubmix.com/ideogram/edit](https://api.aihubmix.com/ideogram/edit)

Edita de forma sincrónica una imagen especificada utilizando la máscara proporcionada. La máscara indica qué partes de la imagen se deben editar, mientras que el prompt y el tipo de estilo seleccionado pueden guiar aún más la dirección de la edición. Los formatos de imagen admitidos incluyen JPEG, PNG y WebP. Los enlaces de las imágenes tienen un periodo de validez limitado; si quieres conservarlas, debes descargarlas y guardarlas.

**Parámetros de la solicitud**

<ParamField body="image_file" type="file" required>
  Archivo de imagen original; admite formatos JPEG, PNG y WebP
</ParamField>

<ParamField body="mask" type="file" required>
  Imagen de máscara que debe cumplir los siguientes requisitos:

  * Contiene únicamente píxeles en blanco y negro, admite formatos de imagen RGB, RGBA o en escala de grises
  * Tiene exactamente las mismas dimensiones que la imagen original
  * Las áreas negras representan las partes que deben modificarse y las áreas blancas las partes que deben permanecer sin cambios
  * No puede ser totalmente blanca
  * El área modificada (parte negra) debe ocupar al menos el 10 % del área de la imagen
</ParamField>

<ParamField body="prompt" type="string" required>
  Prompt para la edición local
</ParamField>

<ParamField body="model" type="string" required>
  Modelo para generar o editar imágenes. /generate y /remix admiten todos los tipos de modelo, pero /edit solo admite V\_2 y V\_2\_TURBO.

  Versiones de modelo disponibles:

  * V\_2
  * V\_2\_TURBO
</ParamField>

<ParamField body="magic_prompt_option" default="AUTO" type="string">
  Opción de mejora del prompt. Parámetros disponibles: AUTO, ON, OFF
</ParamField>

<ParamField body="num_images" default="1" type="integer">
  Número de imágenes a generar, rango 1-8
</ParamField>

<ParamField body="seed" type="integer">
  Semilla aleatoria, rango: 0-2147483647
</ParamField>

<ParamField body="style_type" default="AUTO" type="string">
  Tipo de estilo utilizado para generar imágenes; este parámetro solo se aplica a las versiones V\_2 y superiores del modelo.

  Estilos disponibles:

  * AUTO
  * GENERAL
  * REALISTIC
  * DESIGN
  * RENDER\_3D
  * ANIME
</ParamField>

### Ejemplos de llamada

<CodeGroup>
  ```py Python theme={null}
  import requests
  import os

  url = "https://aihubmix.com/ideogram/eidt"

  files = {
      "image_file": open('<file1>', 'rb'), #required
      "mask": "open('<file1>', 'rb')" #required
  }

  payload = {
      "prompt": "\"prompt\"", #required
      "model": "V_2",  #required, only supported for V_2 and V_2_TURBO.
      "magic_prompt_option": ,
      "num_images":1, #integer optional >=1 <=8 Defaults to 1
      "seed": , #integer optional >=0 <=2147483647
      "style_type":
  16}
  headers = {"Api-Key": os.getenv("AIHUBMIX_API_KEY")}

  response = requests.post(url, data=payload, files=files, headers=headers)

  print(response.json()

  # close file
  files["image_file"].close()
  files["mask"].close()
  ```

  ```js Javascript theme={null}
  const url = 'https://aihubmix.com/ideogram/edit';
  const form = new FormData();
  form.append('image_file', '<file1>');
  form.append('mask', '<file1>');
  form.append('prompt', '"prompt"');
  form.append('model', '"V_1"');
  form.append('magic_prompt_option', '');
  form.append('num_images', '');
  form.append('seed', '');
  form.append('style_type', '');

  const options = {method: 'POST', headers: {'Api-Key': '<apiKey>'}};

  options.body = form;

  try {
    const response = await fetch(url, options);
    const data = await response.json();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
  ```

  ```shell Curl theme={null}
  curl -X POST https://aihubmix.com/ideogram/edit \
       -H "Api-Key: <apiKey>" \
       -H "Content-Type: multipart/form-data" \
       -F image_file=@<file1> \
       -F mask=@<file1> \
       -F prompt="prompt" \
       -F model="V_1"
  ```
</CodeGroup>

### Respuesta

Ediciones de imagen generadas correctamente.

```json theme={null}
{
  "created": "2000-01-23T04:56:07Z",
  "data": [
    {
      "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.",
      "resolution": "1024x1024",
      "is_image_safe": true,
      "seed": 12345,
      "url": "https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g",
      "style_type": "REALISTIC"
    }
  ]
}
```

### Códigos de error

* `400` : Post Edit Image Request Bad Request Error
* `401` : Post Edit Image Request Unauthorized Error
* `422` : Post Edit Image Request Unprocessable Entity Error
* `429` : Post Edit Image Request Too Many Requests Error

### Remix

`POST` [https://aihubmix.com/ideogram/remix](https://api.aihubmix.com/ideogram/remix)

Fusiona la imagen proporcionada con los prompts dados y parámetros opcionales. Las imágenes de entrada se recortan a la relación de aspecto seleccionada antes del remix. Los formatos de imagen admitidos incluyen JPEG, PNG y WebP. Los enlaces de las imágenes tienen un periodo de validez limitado; si quieres conservarlas, debes descargarlas y guardarlas.

**Parámetros de la solicitud**

<ParamField body="image_request" type="object" required>
  Solicitud para generar nuevas imágenes usando la imagen y el prompt proporcionados. La imagen proporcionada se recortará para coincidir con la relación de aspecto de salida seleccionada.
</ParamField>

<ParamField body="image_request.prompt" type="string" required>
  Prompt para la generación de la imagen
</ParamField>

<ParamField body="image_request.aspect_ratio" default="ASPECT_1_1" type="string">
  Relación de aspecto para la generación de la imagen, determina la resolución. No se puede usar junto con el parámetro resolution.

  Relaciones disponibles:

  * ASPECT\_1\_1
  * ASPECT\_3\_1
  * ASPECT\_1\_3
  * ASPECT\_3\_2
  * ASPECT\_2\_3
  * ASPECT\_4\_3
  * ASPECT\_3\_4
  * ASPECT\_16\_9
  * ASPECT\_9\_16
  * SPECT\_16\_10
  * ASPECT\_10\_16
</ParamField>

<ParamField body="image_request.image_weight" default="50" type="integer">
  Peso de la imagen de referencia, rango: 1-100
</ParamField>

<ParamField body="image_request.model" default="V_2" type="string">
  Modelo para generar o editar imágenes. /generate y /remix admiten todos los tipos de modelo, pero /edit solo admite V\_2 y V\_2\_TURBO.
</ParamField>

<ParamField body="image_request.negative_prompt" type="string">
  Describe lo que no quieres que aparezca en la imagen. Solo se aplica a las versiones de modelo V\_1, V\_1\_TURBO, V\_2 y V\_2\_TURBO. Las descripciones en el prompt tienen prioridad sobre las descripciones en el negative prompt.
</ParamField>

<ParamField body="image_request.magic_prompt_option" default="AUTO" type="string">
  Opción de mejora del prompt. Parámetros disponibles: AUTO, ON, OFF
</ParamField>

<ParamField body="image_request.num_images" default="1" type="integer">
  Número de imágenes a generar, rango: 1-8
</ParamField>

<ParamField body="image_request.resolution" type="string">
  Resolución para la generación de la imagen (solo aplicable a la versión 2.0 del modelo, no se puede usar junto con aspect\_ratio), expresada como ancho x alto. Si no se especifica, se usará aspect\_ratio por defecto.
</ParamField>

<ParamField body="image_request.seed" type="integer">
  Semilla aleatoria, rango: 0-2147483647
</ParamField>

<ParamField body="image_request.style_type" default="AUTO" type="string">
  Tipo de estilo para las imágenes generadas; solo se aplica a las versiones V\_2 y superiores del modelo, no debe especificarse en las versiones V\_1.

  Estilos disponibles:

  * AUTO
  * GENERAL
  * REALISTIC
  * DESIGN
  * RENDER\_3D
  * ANIME
</ParamField>

<ParamField body="image_file" type="file" required>
  Archivo de imagen original; admite formatos JPEG, PNG y WebP
</ParamField>

### Ejemplos de llamada

<CodeGroup>
  ```py Python theme={null}
  import requests
  import os

  url = "https://aihubmix.com/ideogram/remix"

  files = { "image_file": open('<file1>', 'rb') }
  payload = {"image_request": '''{
      "prompt": "watercolor",
      "aspect_ratio": "ASPECT_10_16",
      "image_weight": 50,
      "magic_prompt_option": "ON",
      "model": "V_2"
  }'''}

  headers = {"Api-Key": os.getenv("AIHUBMIX_API_KEY")}

  response = requests.post(url, data=payload, files=files, headers=headers)

  print(response.json())
  ```

  ```js Javascript theme={null}
  const url = 'https://aihubmix.com/ideogram/remix';
  const form = new FormData();
  form.append('image_request', '{
    "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.",
    "aspect_ratio": "ASPECT_10_16",
    "image_weight": 50,
    "magic_prompt_option": "ON",
    "model": "V_2"
  }');
  form.append('image_file', '<file1>');

  const options = {method: 'POST', headers: {'Api-Key': '<apiKey>'}};

  options.body = form;

  try {
    const response = await fetch(url, options);
    const data = await response.json();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
  ```

  ```shell Curl theme={null}
  curl -X POST https://aihubmix.com/ideogram/remix \
       -H "Api-Key: <apiKey>" \
       -H "Content-Type: multipart/form-data" \
       -F image_request='{
    "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.",
    "aspect_ratio": "ASPECT_10_16",
    "image_weight": 50,
    "magic_prompt_option": "ON",
    "model": "V_2"
  }' \
       -F image_file=@<file1>
  ```
</CodeGroup>

### Respuesta

Imagen(es) generada(s) correctamente.

```json theme={null}
{
  "created": "2000-01-23T04:56:07Z",
  "data": [
    {
      "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.",
      "resolution": "1024x1024",
      "is_image_safe": true,
      "seed": 12345,
      "url": "https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g",
      "style_type": "REALISTIC"
    }
  ]
}
```

### Códigos de error

* `400` : Post Remix Image Request Bad Request Error
* `401` : Post Remix Image Request Unauthorized Error
* `422` : Post Remix Image Request Unprocessable Entity Error
* `429` : Post Remix Image Request Too Many Requests Error

### Upscale

`POST` [https://aihubmix.com/ideogram/upscale](https://api.aihubmix.com/ideogram/upscale)

Aumenta de forma sincrónica la resolución de la imagen proporcionada con prompts opcionales. Los formatos de imagen admitidos incluyen JPEG, PNG y WebP. Los enlaces de las imágenes tienen un periodo de validez limitado; si quieres conservarlas, debes descargarlas y guardarlas.

**Parámetros de la solicitud**

<ParamField body="image_request" type="object" required>
  Objeto de solicitud para aumentar la resolución de la imagen proporcionada con prompts opcionales
</ParamField>

<ParamField body="image_request.prompt" type="string">
  Prompt opcional para guiar el proceso de aumento de resolución
</ParamField>

<ParamField body="image_request.resemblance" default="50" type="integer">
  Similitud, rango: 1-100
</ParamField>

<ParamField body="image_request.detail" default="50" type="integer">
  Detalle, rango: 1-100
</ParamField>

<ParamField body="image_request.magic_prompt_option" default="AUTO" type="string">
  Opción de mejora del prompt. Parámetros disponibles: AUTO, ON, OFF
</ParamField>

<ParamField body="image_request.num_images" default="1" type="integer">
  Número de imágenes a generar, rango: 1-8
</ParamField>

<ParamField body="image_request.seed" type="integer">
  Semilla aleatoria, rango: 0-2147483647
</ParamField>

<ParamField body="image_file" type="file" required>
  Archivo de imagen original; admite formatos JPEG, PNG y WebP
</ParamField>

### Ejemplos de llamada

<CodeGroup>
  ```py Python theme={null}
  import requests
  import os

  url = "https://aihubmix.com/ideogram/upscale"

  files = { "image_file": open('<file1>', 'rb') }
  payload = { "image_request": "{}" }
  headers = {"Api-Key": os.getenv("AIHUBMIX_API_KEY")}

  response = requests.post(url, data=payload, files=files, headers=headers)

  print(response.json())
  ```

  ```js Javascript theme={null}
  const url = 'https://aihubmix.com/ideogram/upscale';
  const form = new FormData();
  form.append('image_request', '{}');
  form.append('image_file', '<file1>');

  const options = {method: 'POST', headers: {'Api-Key': '<apiKey>'}};

  options.body = form;

  try {
    const response = await fetch(url, options);
    const data = await response.json();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
  ```

  ```shell Curl theme={null}
  curl -X POST https://aihubmix.com/ideogram/upscale \
       -H "Api-Key: <apiKey>" \
       -H "Content-Type: multipart/form-data" \
       -F image_request='{}' \
       -F image_file=@<file1>
  ```
</CodeGroup>

### Respuesta

Imagen(es) generada(s) correctamente.

```json theme={null}
{
  "created": "2000-01-23T04:56:07Z",
  "data": [
    {
      "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there's an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.",
      "resolution": "1024x1024",
      "is_image_safe": true,
      "seed": 12345,
      "url": "https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g",
      "style_type": "REALISTIC"
    }
  ]
}
```

### Códigos de error

* `400` : Post Upscale Image Request Bad Request Error
* `401` : Post Upscale Image Request Unauthorized Error
* `422` : Post Upscale Image Request Unprocessable Entity Error
* `429` : Post Upscale Image Request Too Many Requests Error

### Describe

`POST` [https://aihubmix.com/ideogram/describe](https://api.aihubmix.com/ideogram/describe)

Analiza y describe la imagen subida. Los formatos de imagen admitidos incluyen JPEG, PNG y WebP.

**Parámetros de la solicitud**

<ParamField body="image_file" type="file" required>
  Archivo de imagen a describir; admite formatos JPEG, PNG y WebP
</ParamField>

### Ejemplos de llamada

<CodeGroup>
  ```py Python theme={null}
  import requests
  import os

  url = "https://aihubmix.com/ideogram/describe"

  files = { "image_file": open('<file1>', 'rb') }
  headers = {"Api-Key": os.getenv("AIHUBMIX_API_KEY")}

  response = requests.post(url, files=files, headers=headers)

  print(response.json())

  # close file
  files["image_file"].close()
  ```

  ```js Javascript theme={null}
  const url = 'https://aihubmix.com/ideogram/describe';
  const form = new FormData();
  form.append('image_file', '<file1>');

  const options = {method: 'POST', headers: {'Api-Key': '<apiKey>'}};

  options.body = form;

  try {
    const response = await fetch(url, options);
    const data = await response.json();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
  ```

  ```shell Curl theme={null}
  curl -X POST https://aihubmix.com/ideogram/describe \
       -H "Api-Key: <apiKey>" \
       -H "Content-Type: multipart/form-data" \
       -F image_file=@<file1>
  ```
</CodeGroup>

### Respuesta

Descripción(es) creada(s) correctamente.

```json theme={null}
{
  "descriptions": [
    {
      "text": "A meticulously illustrated cat with striped patterns, sitting upright. The cat's eyes are a captivating shade of yellow, and it appears to be gazing intently at something. The background consists of abstract, swirling patterns in shades of black, white, and beige, creating an almost fluid or wavy appearance. The cat is positioned in the foreground, with the background elements fading into the distance, giving a sense of depth to the image."
    },
    {
      "text": "A meticulously illustrated cat with striped patterns, sitting upright. The cat's eyes are a captivating shade of yellow, and it appears to be gazing intently at something. The background consists of abstract, swirling patterns in shades of black, white, and beige, creating an almost fluid or wavy appearance. The cat is positioned in the foreground, with the background elements fading into the distance, giving a sense of depth to the image."
    }
  ]
}
```

### Códigos de error

* `400` : Post Describe Request Bad Request Error
* `422` : Post Describe Request Unprocessable Entity Error
* `429` : Post Describe Request Too Many Requests Error

***

### 💰 Precios de V2 y V1

#### Generación de imágenes

| Modelo    | Función                                                                                                    | Coste por imagen |
| --------- | ---------------------------------------------------------------------------------------------------------- | ---------------- |
| 2a        | Texto a imagen, o texto + imagen de referencia a imagen                                                    | US \$0.04        |
| 2a Turbo  | Texto a imagen, o texto + imagen de referencia a imagen (más rápido pero con calidad ligeramente inferior) | US \$0.025       |
| 2.0       | Texto a imagen, o texto + imagen de referencia a imagen                                                    | US \$0.08        |
| 2.0 Turbo | Texto a imagen, o texto + imagen de referencia a imagen (más rápido pero con calidad ligeramente inferior) | US \$0.05        |
| 1.0       | Texto a imagen, o texto + imagen de referencia a imagen                                                    | US \$0.06        |
| 1.0 Turbo | Texto a imagen, o texto + imagen de referencia a imagen (más rápido pero con calidad ligeramente inferior) | US \$0.02        |

#### Edición de imágenes

| Modelo         | Función                                                                                                                                  | Coste por imagen |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
| 2.0 Edit       | Regenera imágenes usando prompts de texto, imágenes de referencia y máscaras binarias                                                    | US \$0.08        |
| 2.0 Turbo Edit | Regenera imágenes usando prompts de texto, imágenes de referencia y máscaras binarias (más rápido pero con calidad ligeramente inferior) | US \$0.05        |

#### Mejora de imágenes

| Modelo  | Función                                                                                  | Coste por imagen |
| ------- | ---------------------------------------------------------------------------------------- | ---------------- |
| Upscale | Aumenta la resolución de la imagen de referencia 2x, mejorando potencialmente la calidad | US \$0.06        |

## Para más detalles, consulta la [documentación oficial](https://developer.ideogram.ai/api-reference/api-reference/generate)

Última actualización: 2026-06-01
