{"record":{"id":"b5e4ad77f985de14","repo":"run-llama/llama_index","slug":"no-image-found-in-node","errorCode":null,"errorMessage":"No image found in node.","messagePattern":"No image found in node\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/schema.py","lineNumber":911,"sourceCode":"    def class_name(cls) -> str:\n        return \"ImageNode\"\n\n    def resolve_image(self) -> ImageType:\n        \"\"\"Resolve an image such that PIL can read it.\"\"\"\n        if self.image is not None:\n            import base64\n\n            return BytesIO(base64.b64decode(self.image))\n        elif self.image_path is not None:\n            return self.image_path\n        elif self.image_url is not None:\n            # load image from URL\n            import requests\n\n            response = requests.get(self.image_url, timeout=(60, 60))\n            return BytesIO(response.content)\n        else:\n            raise ValueError(\"No image found in node.\")\n\n    @property\n    def hash(self) -> str:\n        \"\"\"Get hash of node.\"\"\"\n        # doc identity depends on if image, image_path, or image_url is set\n        image_str = self.image or \"None\"\n        image_path_str = self.image_path or \"None\"\n        image_url_str = self.image_url or \"None\"\n        image_text = self.text or \"None\"\n        doc_identity = f\"{image_str}-{image_path_str}-{image_url_str}-{image_text}\"\n        return str(sha256(doc_identity.encode(\"utf-8\", \"surrogatepass\")).hexdigest())\n\n    def get_content_blocks(\n        self, metadata_mode: MetadataMode = MetadataMode.NONE\n    ) -> list[BaseContentBlock]:\n        \"\"\"Get content blocks for the node.\"\"\"\n        from llama_index.core.base.llms.types import ImageBlock\n","sourceCodeStart":893,"sourceCodeEnd":929,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/schema.py#L893-L929","documentation":"ImageNode.resolve_image() tries three image sources in order — embedded base64 (image), image_path, image_url — and raises ValueError('No image found in node.') when none of the three fields is set. The node exists but carries no image payload at all.","triggerScenarios":"Constructing ImageNode() (or a subclass) without image/image_path/image_url, or creating one only with text/metadata, then calling resolve_image() — typically inside a multi-modal retrieval or LLM image-input flow.","commonSituations":"Building ImageNode placeholders in custom multi-modal pipelines; nodes created from documents where the image extraction step silently failed and only text was attached.","solutions":["Pass exactly one of image (base64 str), image_path, or image_url when constructing the ImageNode","Guard with a check on the three fields before calling resolve_image()","If images are optional in your pipeline, skip resolve_image for image-less nodes instead of erroring"],"exampleFix":"# before\nnode = ImageNode(text=\"chart description\")\nimg = node.resolve_image()  # ValueError\n\n# after\nnode = ImageNode(image_path=\"/data/chart.png\", text=\"chart description\")\nimg = node.resolve_image()","handlingStrategy":"validation","validationCode":"if not (node.image or node.image_path or node.image_url):\n    raise ValueError(\"ImageNode needs one of image/image_path/image_url\")","typeGuard":"def has_image_payload(node) -> bool:\n    return bool(getattr(node, \"image\", None) or getattr(node, \"image_path\", None) or getattr(node, \"image_url\", None))","tryCatchPattern":null,"preventionTips":["Always set one image field when constructing ImageNode","Skip resolve_image for text-only nodes","Log which image source is populated before resolving"],"tags":["schema","multimodal","images","nodes"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}