{"record":{"id":"96a375f70497e628","repo":"Comfy-Org/ComfyUI","slug":"thinking-can-only-be-disabled-for-text-to-image","errorCode":null,"errorMessage":"'thinking' can only be disabled for text-to-image; enable it when using reference images.","messagePattern":"'thinking' can only be disabled for text-to-image; enable it when using reference images\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bytedance.py","lineNumber":1010,"sourceCode":"                )\n            if out_num_pixels > 16_777_216:\n                raise ValueError(\n                    f\"Maximum image resolution for the selected model is 16.78MP, but {mp_provided:.2f}MP provided.\"\n                )\n\n        image_tensors: list[Input.Image] = [t for t in images_dict.values() if t is not None]\n        n_input_images = sum(get_number_of_images(t) for t in image_tensors)\n        max_num_of_images = 14 if model_id == \"seedream-5-0-260128\" else 10\n        if n_input_images > max_num_of_images:\n            raise ValueError(\n                f\"Maximum of {max_num_of_images} reference images are supported, but {n_input_images} received.\"\n            )\n        if sequential_image_generation == \"auto\" and n_input_images + max_images > 15:\n            raise ValueError(\n                \"The maximum number of generated images plus the number of reference images cannot exceed 15.\"\n            )\n        if not thinking and n_input_images > 0:\n            raise ValueError(\n                \"'thinking' can only be disabled for text-to-image; enable it when using reference images.\"\n            )\n\n        reference_images_urls: list[str] = []\n        if image_tensors:\n            for tensor in image_tensors:\n                validate_image_aspect_ratio(tensor, (1, 3), (3, 1))\n            reference_images_urls = await upload_images_to_comfyapi(\n                cls,\n                image_tensors,\n                max_images=n_input_images,\n                mime_type=\"image/png\",\n                wait_label=\"Uploading reference images\",\n            )\n\n        optimize_prompt_options = None\n        if n_input_images == 0:\n            optimize_prompt_options = Seedream5OptimizePromptOptions(thinking=\"enabled\" if thinking else \"disabled\")","sourceCodeStart":992,"sourceCodeEnd":1028,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bytedance.py#L992-L1028","documentation":"Raised by ByteDanceSeedreamNodeV2 when the 'thinking' toggle is disabled (advanced input, default True) while reference images are connected. Seedream's prompt-optimization reasoning can only be turned off for pure text-to-image requests; image-conditioned requests must keep it enabled.","triggerScenarios":"Connecting any image input (model dict 'images' with non-None tensors) and setting thinking=False in the node's advanced settings.","commonSituations":"Turning off thinking to save time on a text-to-image workflow, then adding a reference image later without re-enabling it; copying a node configuration between t2i and i2i workflows.","solutions":["Re-enable 'thinking' (leave it True) whenever reference images are connected.","Remove the reference images if you truly want thinking disabled.","Keep thinking at its default True unless the request is pure text-to-image."],"exampleFix":"// before\nthinking: false\nimages: [reference.png] // -> raises\n\n// after\nthinking: true\nimages: [reference.png] // passes","handlingStrategy":"validation","validationCode":"if image_tensors:  # any reference images connected\n    thinking = True  # force-enable; cannot be off for i2i","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat thinking=True as the only valid setting in image-conditioned workflows.","Audit node configs copied between t2i and i2i graphs."],"tags":["bytedance","seedream","thinking","validation","api-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}