{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rawa-ai/json-schema/rawa-ai-halax-image-workflow-input-api-schema.json",
  "title": "HalaxImageWorkflowInputAPI",
  "description": "API input for the halaX image workflow.\n\nhalaX is the hand-tuned harness behind the platform's image generation: a\nGemini tool-calling agent rewrites the brief before the image model sees\nit, then the brand's model (Nano Banana Pro by default) draws it.\n\n``parts`` is the already-spliced brief in authoring order — the user's\nprompt with every tagged product, place, ambassador or logo replaced by an\ninstruction plus its image, and reference images appended. Image parts\naccept an ``s3_key`` (presigned per call) or a public ``url``.\n``brand`` carries what the agent may pull in with its tools: the light and\ndark logo keys and the brand identity (color palette with per-color\ninstructions, palette image, typography). ``photography_guidelines`` and\n``brand_voice`` are preformatted prompt blocks; send empty strings when the\nbrand has none.\n\nSet ``mode`` to ``scene`` for a text-free photographic base plate (the\nGraphics Agent's use): the agent loses its graphics and logo tools and the\nimage model is told to leave the frame free of text and marks.",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/rawa-ai-api-openapi.json#/components/schemas/HalaxImageWorkflowInputAPI",
  "properties": {
    "parts": {
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/TextPart"
          },
          {
            "$ref": "#/$defs/ImagePart"
          }
        ]
      },
      "type": "array",
      "title": "Parts",
      "description": "The brief in authoring order: text parts plus images by s3_key or url. At least one non-empty text part is required."
    },
    "mode": {
      "type": "string",
      "enum": [
        "image",
        "scene"
      ],
      "title": "Mode",
      "description": "'image': a standalone generation (photos, or ads with in-image graphics). 'scene': a text-free photographic base plate.",
      "default": "image"
    },
    "brand": {
      "$ref": "#/$defs/HalaxBrandAssets",
      "description": "Logo keys, brand hex colors and font family names the enhancement agent may use"
    },
    "photography_guidelines": {
      "type": "string",
      "title": "Photography Guidelines",
      "description": "Preformatted photography guidance block, or empty",
      "default": ""
    },
    "brand_voice": {
      "type": "string",
      "title": "Brand Voice",
      "description": "Preformatted brand voice block, or empty",
      "default": ""
    },
    "has_reference_images": {
      "type": "boolean",
      "title": "Has Reference Images",
      "description": "Whether any part is a reference image (steers the agent)",
      "default": false
    },
    "is_reference_only": {
      "type": "boolean",
      "title": "Is Reference Only",
      "description": "Reference image(s) with no instruction of their own: the reference is the brief and the agent must not embellish it",
      "default": false
    },
    "allow_religious_content": {
      "type": "boolean",
      "title": "Allow Religious Content",
      "description": "Allow religious text, symbols and imagery. When false the enhanced prompt carries an explicit restriction.",
      "default": false
    },
    "prompt_enhancement": {
      "type": "boolean",
      "title": "Prompt Enhancement",
      "description": "Run the enhancement agent; false sends the parts as given",
      "default": true
    },
    "image_model": {
      "type": "string",
      "enum": [
        "nano_banana_pro",
        "gpt_image_2_5"
      ],
      "title": "Image Model",
      "description": "The brand's image model",
      "default": "nano_banana_pro"
    },
    "aspect_ratio": {
      "type": "string",
      "enum": [
        "1:1",
        "9:16",
        "16:9",
        "4:3",
        "3:4",
        "21:9",
        "3:2",
        "2:3",
        "5:4",
        "4:5"
      ],
      "title": "Aspect Ratio",
      "description": "Output aspect ratio; for gpt_image_2_5 it is mapped to the nearest supported pixel size",
      "default": "1:1"
    },
    "image_size": {
      "type": "string",
      "enum": [
        "1K",
        "2K",
        "4K"
      ],
      "title": "Image Size",
      "description": "Nano Banana Pro size tier (ignored by gpt_image_2_5)",
      "default": "2K"
    },
    "output_path": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Output Path",
      "description": "S3 prefix for the image and its thumbnail (e.g. 'brands/<brand_id>/creativeAssets')"
    },
    "webhook_url": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2083,
          "minLength": 1,
          "format": "uri"
        },
        {
          "type": "null"
        }
      ],
      "title": "Webhook Url"
    }
  },
  "type": "object",
  "required": [
    "parts"
  ],
  "$defs": {
    "HalaxBrandAssets": {
      "properties": {
        "light_logo_s3_key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Light Logo S3 Key"
        },
        "dark_logo_s3_key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Dark Logo S3 Key"
        },
        "colors": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Colors"
        },
        "fonts": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Fonts"
        }
      },
      "type": "object",
      "title": "HalaxBrandAssets",
      "description": "Brand records the enhancement agent may pull in with its tools."
    },
    "ImagePart": {
      "properties": {
        "type": {
          "type": "string",
          "const": "image",
          "title": "Type",
          "default": "image"
        },
        "url": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2083,
              "minLength": 1,
              "format": "uri"
            },
            {
              "type": "null"
            }
          ],
          "title": "Url"
        },
        "s3_key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "S3 Key"
        },
        "role": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "first_frame",
                "last_frame",
                "reference_image"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Role"
        }
      },
      "type": "object",
      "title": "ImagePart",
      "description": "An image content part - provide either url or s3_key.\n\nThe optional ``role`` is used by workflows that need to distinguish\nimages semantically (e.g. Gemini Omni Flash expects ``first_frame``,\n``last_frame`` or ``reference_image``). Workflows that don't care\nabout roles ignore the field."
    },
    "TextPart": {
      "properties": {
        "type": {
          "type": "string",
          "const": "text",
          "title": "Type",
          "default": "text"
        },
        "content": {
          "type": "string",
          "title": "Content"
        }
      },
      "type": "object",
      "required": [
        "content"
      ],
      "title": "TextPart",
      "description": "A text content part."
    }
  }
}