{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pixeldojo-ai/json-schema/pixeldojo-ai-flux2-klein9b-request-schema.json",
  "title": "Flux 2 Klein 9BRequest",
  "description": "4-step distilled FLUX.2 [klein] foundation model for flexible control",
  "x-generated": "2026-12-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pixeldojo-ai-openapi.yml#/components/schemas/Flux2Klein9bRequest",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "prompt": {
      "title": "Prompt",
      "description": "Text description of the image to generate",
      "type": "string"
    },
    "input_images": {
      "title": "Input Images (multi-image edit)",
      "description": "Optional array of reference image URLs (up to 10). When supplied, the request becomes a multi-image edit and the model composes / restyles based on the references plus the prompt. Every variant is edit-capable; the per-variant ceiling applies (Flex 10, Pro/Max 8, Dev and Dev + LoRA 4, Klein and Klein 9B + LoRA 5) and extras are dropped. Flex adds 2 credits, Max 1 credit and Dev + LoRA 0.25 credits for each reference image sent, on top of the output price; on those three, each reference is downscaled to at most 1 megapixel (aspect ratio kept) before it is sent, and one we cannot read is refused and refunded. Omit for plain text-to-image.",
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      },
      "maxItems": 10,
      "minItems": 0
    },
    "aspect_ratio": {
      "title": "Aspect ratio",
      "description": "Output aspect ratio. Pass `match_input_image` to inherit the aspect of the first input image (multi-image edits only). Pass `custom` with `width` and `height` (each rounded to a multiple of 32) for a free-form size; on Flex and Max that size is billed as the smallest resolution tier holding it (1 MP = 1024 x 1024) and can be at most 4 MP (2048 x 2048).",
      "type": "string",
      "enum": [
        "1:1",
        "16:9",
        "9:16",
        "3:2",
        "2:3",
        "4:5",
        "5:4",
        "3:4",
        "4:3",
        "custom",
        "match_input_image"
      ],
      "default": "1:1",
      "x-option-labels": {
        "match_input_image": "Match input",
        "1:1": "1:1",
        "16:9": "16:9",
        "3:2": "3:2",
        "2:3": "2:3",
        "4:5": "4:5",
        "5:4": "5:4",
        "9:16": "9:16",
        "3:4": "3:4",
        "4:3": "4:3",
        "custom": "Custom"
      }
    },
    "resolution": {
      "title": "Resolution",
      "description": "Output resolution in megapixels",
      "type": "string",
      "enum": [
        "0.5 MP",
        "1 MP",
        "2 MP",
        "4 MP"
      ],
      "default": "1 MP"
    },
    "safety_tolerance": {
      "title": "Safety tolerance",
      "description": "Content filter strictness (1=strict, 5=permissive)",
      "type": "integer",
      "default": 5,
      "minimum": 1,
      "maximum": 5
    },
    "prompt_upsampling": {
      "title": "Prompt upsampling",
      "description": "Provider-side LLM prompt rewriting. Off by default so your exact prompt is followed. Turn on to auto-enhance short prompts.",
      "type": "boolean",
      "default": false
    },
    "seed": {
      "title": "Seed",
      "description": "Random seed for reproducibility",
      "type": "integer"
    },
    "output_format": {
      "title": "Output format",
      "description": "Image output format",
      "type": "string",
      "enum": [
        "png",
        "jpg",
        "webp"
      ],
      "default": "png"
    },
    "loras": {
      "title": "LoRAs",
      "description": "Custom LoRA weights, applied by the flux-2-lora (Klein 9B LoRAs) and flux-2-dev-lora (FLUX.2 [dev] LoRAs) variants only and ignored by the others. Each entry is an object: {\"url\": \"<safetensors URL>\", \"scale\": 1.0}. Up to 3 stack, extras are dropped, and scale defaults to 1.0. The URL must be a LoRA you trained here or a Hugging Face / Civitai link. On flux-2-dev-lora, the first request with a LoRA it has not seen yet answers that the LoRA is being prepared (a few minutes; the credits are refunded); retry after that.",
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 3
    },
    "model": {
      "title": "Model",
      "description": "Model variant to use.",
      "type": "string",
      "enum": [
        "black-forest-labs/flux-2-flex",
        "black-forest-labs/flux-2-klein-4b",
        "black-forest-labs/flux-2-klein-9b",
        "black-forest-labs/flux-2-pro",
        "black-forest-labs/flux-2-max",
        "black-forest-labs/flux-2-dev",
        "fal-ai/flux-2/lora",
        "black-forest-labs/flux-2-dev-lora"
      ],
      "default": "black-forest-labs/flux-2-klein-9b"
    },
    "images": {
      "title": "Images",
      "description": "Reference image URLs.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "width": {
      "title": "Width",
      "description": "Output width in pixels.",
      "type": "number"
    },
    "height": {
      "title": "Height",
      "description": "Output height in pixels.",
      "type": "number"
    },
    "go_fast": {
      "title": "Go fast",
      "description": "Trade detail for shorter generation time.",
      "type": "boolean",
      "default": true
    },
    "disable_safety_checker": {
      "title": "Disable safety checker",
      "description": "Accepted for backwards compatibility but ignored: provider content moderation is always on for API requests and cannot be disabled.",
      "type": "boolean",
      "default": false
    },
    "output_quality": {
      "title": "Output quality",
      "description": "JPEG/WEBP encoding quality (0–100).",
      "type": "number",
      "default": 80,
      "minimum": 0,
      "maximum": 100
    },
    "num_inference_steps": {
      "title": "Num inference steps",
      "description": "Number of denoising steps. More steps = higher fidelity, slower.",
      "type": "number",
      "default": 28
    },
    "guidance_scale": {
      "title": "Guidance scale",
      "description": "Classifier-free guidance scale. Higher = stricter prompt adherence.",
      "type": "number",
      "default": 2.5
    },
    "acceleration": {
      "title": "Acceleration",
      "description": "Inference acceleration mode. Higher levels trade fidelity for speed.",
      "type": "string",
      "default": "regular"
    },
    "webhook_url": {
      "type": "string",
      "format": "uri",
      "description": "Optional webhook callback for terminal job events."
    }
  },
  "required": [
    "prompt"
  ]
}