{"record":{"id":"3d416ed516c73656","repo":"AUTOMATIC1111/stable-diffusion-webui","slug":"image-not-found","errorCode":null,"errorMessage":"Image not found","messagePattern":"Image not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"modules/api/api.py","lineNumber":633,"sourceCode":"\n        time_since_start = time.time() - shared.state.time_start\n        eta = (time_since_start/progress)\n        eta_relative = eta-time_since_start\n\n        progress = min(progress, 1)\n\n        shared.state.set_current_image()\n\n        current_image = None\n        if shared.state.current_image and not req.skip_current_image:\n            current_image = encode_pil_to_base64(shared.state.current_image)\n\n        return models.ProgressResponse(progress=progress, eta_relative=eta_relative, state=shared.state.dict(), current_image=current_image, textinfo=shared.state.textinfo, current_task=current_task)\n\n    def interrogateapi(self, interrogatereq: models.InterrogateRequest):\n        image_b64 = interrogatereq.image\n        if image_b64 is None:\n            raise HTTPException(status_code=404, detail=\"Image not found\")\n\n        img = decode_base64_to_image(image_b64)\n        img = img.convert('RGB')\n\n        # Override object param\n        with self.queue_lock:\n            if interrogatereq.model == \"clip\":\n                processed = shared.interrogator.interrogate(img)\n            elif interrogatereq.model == \"deepdanbooru\":\n                processed = deepbooru.model.tag(img)\n            else:\n                raise HTTPException(status_code=404, detail=\"Model not found\")\n\n        return models.InterrogateResponse(caption=processed)\n\n    def interruptapi(self):\n        shared.state.interrupt()\n","sourceCodeStart":615,"sourceCodeEnd":651,"githubUrl":"https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/82a973c04367123ae98bd9abdf80d9eda9b910e2/modules/api/api.py#L615-L651","documentation":"HTTP 404 raised by interrogateapi when the request body for /sdapi/v1/interrogate has no image field (interrogatereq.image is None). The image must be a base64 string (or URL/data URI when enabled) that decode_base64_to_image can turn into a PIL image for CLIP or deepdanbooru tagging.","triggerScenarios":"POST /sdapi/v1/interrogate with {\"model\":\"clip\"} and no image key, or image explicitly null; Pydantic marks image optional so FastAPI won't 422 it first.","commonSituations":"Clients testing the interrogate endpoint with model only; payload field named 'image_b64' or 'init_images' instead of 'image'; JSON serialization dropping empty fields.","solutions":["Send {\"image\": \"<base64>\", \"model\": \"clip\"}","Verify with a minimal curl before integrating: curl -X POST .../sdapi/v1/interrogate -d '{\"image\":\"iVBOR...\",\"model\":\"clip\"}'"],"exampleFix":"# before\njson={'model':'clip'}\n\n# after\njson={'model':'clip','image':base64.b64encode(open('a.png','rb').read()).decode()}","handlingStrategy":"validation","validationCode":"assert payload.get('image'), 'interrogate requires image: <base64>'\nimport base64; base64.b64decode(payload['image'], validate=True)  # raises early on bad data","typeGuard":"def is_valid_interrogate_payload(p: dict) -> bool:\n    return isinstance(p.get('image'), str) and len(p['image']) > 0","tryCatchPattern":null,"preventionTips":["Use the exact field name 'image'","Round-trip decode base64 before sending","Smoke-test the endpoint after schema changes"],"tags":["api","interrogate","http-404","validation","stable-diffusion-webui"],"backgroundTag":null,"analyzedSha":"82a973c04367123ae98bd9abdf80d9eda9b910e2","analyzedAt":"2026-08-14T16:46:43.225Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}