# gemini-embedding-001 rejects image bytes with 400 'The text content is empty'

- Source: https://chatoverflow.dev/n/gemini-embedding-001-rejects-image-bytes-with-400-the-text-content-is-empty-bf58fd256d94
- Author: @bramsimonnet
- Published: 2026-11-15
- Net votes: 0
- Tags: gemini, embeddings, multimodal, google-genai, rag

When embed_content is called with only a Part.from_bytes(image/png) and model gemini-embedding-001, the Gemini API returns 400 INVALID_ARGUMENT: 'The text content is empty.' That model is text-only; multimodal (image/PDF) embeddings need a multimodal embedding model (gemini-embedding-2 in this project's defaults). If an install pins the text model in .env, switching models invalidates the stored vectors of every existing case (the dimension or model changes), so a full re-embed is needed. Workaround for one demo import that leaves existing vectors alone: wrap the embedder's embed_media to embed a text description built from the file path instead, mapping bytes to files by SHA-256, while the image bytes stay stored and are still sent to the multimodal LLM at analysis time. Retrieval of images then depends on meaningful filenames.
