pbakaus/impeccable · warning
embed-prompt: no embedded prompt found
Error message
embed-prompt: no embedded prompt found
What it means
In read mode (`embed-prompt --read` or similar), the CLI attempts to extract an embedded generation prompt from the image (PNG tEXt chunk or JPEG COM segment). If neither container carries the keyword-marked prompt, it prints this and exits with code 2.
Source
Thrown at crates/context/src/embed_prompt.rs:253
}
let Some(file) = file.filter(|f| exists(&abs(f))) else {
io.err("embed-prompt: image file required\n");
return 1;
};
let file_abs = abs(&file);
let buf = std::fs::read(&file_abs).unwrap_or_default();
let ty = image_type(&buf);
let png = ty == Some(ImageType::Png);
let jpeg = ty == Some(ImageType::Jpeg);
let sidecar = format!("{}.json", file);
let sidecar_abs = format!("{}.json", file_abs);
if read_mode {
let prompt = read_prompt(&file_abs, &buf);
match prompt {
None => {
io.err("embed-prompt: no embedded prompt found\n");
2
}
Some(p) => {
io.out(&format!("{}\n", p));
0
}
}
} else {
let prompt = match arg_of("--prompt") {
Some(p) => Some(p),
None => match arg_of("--prompt-file") {
Some(pf) if !pf.is_empty() => match std::fs::read(abs(&pf)) {
Ok(b) => Some(String::from_utf8_lossy(&b).into_owned()),
Err(e) => {
io.err(&format!("Error: {}\n", crate::util::node_read_error(&pf, &e)));
return 1;
}
},View on GitHub (pinned to 2bc2879276)
Solutions
- Regenerate or re-embed the prompt: run `embed-prompt --image <file> --prompt <p>` in write mode first.
- Check the image did not pass through an optimizer that strips PNG tEXt or JPEG COM segments.
- Keep the original engine-output image (with embedded prompt) alongside optimized variants.
Defensive patterns
Strategy: fallback
Validate before calling
// nothing static to check; presence of embedded metadata is only knowable after read
Try / catch
const p = readEmbeddedPrompt(img); if (p == null) { console.warn('no embedded prompt; using sidecar fallback'); p = readSidecar(img); } Prevention
- Keep originals with embedded prompts alongside optimized copies
- Avoid routing embedded images through optimizers that strip tEXt/COM segments
- Store a .json sidecar as a fallback prompt source
When it happens
Trigger: Running read mode on an image that was never processed by embed-prompt, an image whose embedded prompt was stripped by an optimizer/re-encoder, or a non-PNG/non-JPEG file.
Common situations: Images passed through image optimizers (e.g. squash/recompress tools) that drop ancillary chunks, screenshots of generated images, or hand-authored assets that never had a prompt embedded.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- comp-diff: cannot read comp {comp_path}: {e}
- comp-diff: cannot read build {build_path}: {e}
- comp-spec: cannot read {comp_file}: {e}
- comp-spec: {e}
- comp-spec: cannot read {comp_path}: {e}
AI-assisted analysis of pbakaus/impeccable@2bc2879276 (2026-09-08).
Data as JSON: /api/errors/7095b7f1dc025d5d.
Report an issue: GitHub.