{"record":{"id":"dcaba1072b1b5d7f","repo":"Comfy-Org/ComfyUI","slug":"unknown-model-model","errorCode":null,"errorMessage":"Unknown model: {model}","messagePattern":"Unknown model: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_openai.py","lineNumber":564,"sourceCode":"            if ratio > 3:\n                raise ValueError(\n                    f\"Custom resolution aspect ratio must not exceed 3:1, got {custom_width}x{custom_height}\"\n                )\n            total_pixels = custom_width * custom_height\n            if not 655_360 <= total_pixels <= 8_294_400:\n                raise ValueError(\n                    f\"Custom resolution total pixels must be between 655,360 and 8,294,400, got {total_pixels}\"\n                )\n            size = f\"{custom_width}x{custom_height}\"\n        elif model in (\"gpt-image-1\", \"gpt-image-1.5\"):\n            if size not in (\"auto\", \"1024x1024\", \"1024x1536\", \"1536x1024\"):\n                raise ValueError(f\"Resolution {size} is only supported by GPT Image 2 model\")\n\n        if model == \"gpt-image-2\":\n            if background == \"transparent\":\n                raise ValueError(\"Transparent background is not supported for GPT Image 2 model\")\n        elif model not in (\"gpt-image-1\", \"gpt-image-1.5\"):\n            raise ValueError(f\"Unknown model: {model}\")\n\n        if image is not None:\n            files = []\n            batch_size = image.shape[0]\n            for i in range(batch_size):\n                single_image = image[i : i + 1]\n                scaled_image = downscale_image_tensor(single_image, total_pixels=2048 * 2048).squeeze()\n\n                image_np = (scaled_image.numpy() * 255).astype(np.uint8)\n                img = Image.fromarray(image_np)\n                img_byte_arr = BytesIO()\n                img.save(img_byte_arr, format=\"PNG\")\n                img_byte_arr.seek(0)\n\n                if batch_size == 1:\n                    files.append((\"image\", (f\"image_{i}.png\", img_byte_arr, \"image/png\")))\n                else:\n                    files.append((\"image[]\", (f\"image_{i}.png\", img_byte_arr, \"image/png\")))","sourceCodeStart":546,"sourceCodeEnd":582,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_openai.py#L546-L582","documentation":"Client-side ValueError from the OpenAI image node's model whitelist: the model string is neither gpt-image-2 nor gpt-image-1/1.5, so it falls through to Unknown model. This guards against typos and unsupported model names before any network call.","triggerScenarios":"Passing model strings like 'dall-e-3', 'gpt-image', 'gpt-4o', or a misspelling such as 'gpt-image1' to this node.","commonSituations":"Hand-edited workflow JSON with a wrong model value; combo widget holding a stale value after a rename; attempting to use Dall-E models through the gpt-image node instead of the dedicated nodes.","solutions":["Use one of the supported values: gpt-image-1, gpt-image-1.5, or gpt-image-2","Reset the model widget so it re-populates from the node's current combo options","For Dall-E 2/3, use the dedicated OpenAIImageEdit/legacy nodes instead of this one"],"exampleFix":"// before\nmodel=\"dall-e-3\"\n// after\nmodel=\"gpt-image-1\"  # or \"gpt-image-1.5\" / \"gpt-image-2\"","handlingStrategy":"validation","validationCode":"SUPPORTED = {\"gpt-image-1\", \"gpt-image-1.5\", \"gpt-image-2\"}\nassert model in SUPPORTED, f\"model must be one of {sorted(SUPPORTED)}\"","typeGuard":"def is_supported_model(model: str) -> bool:\n    return model in {\"gpt-image-1\", \"gpt-image-1.5\", \"gpt-image-2\"}","tryCatchPattern":null,"preventionTips":["Pick model values from the node's combo options, never free-typed","Re-select the model widget after node/package updates","Use the dedicated nodes for Dall-E models"],"tags":["openai","gpt-image","model-name","validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}