smart_image_gen v0.7.3: edit_image inherits style from prior tool call

User reported edit_image picking 'juggernaut' (photoreal) for an edit
on a furry image — the LLM didn't carry context, and the tool's
fallback _route_style only sees the edit instruction text, which for
neutral edits ('bigger', 'glowing eyes') has no furry keywords.

Fix in two places:

  1. Tool: _inherited_style scans __messages__ in reverse for prior
     generate_image / edit_image tool calls and returns the style arg
     they used. edit_image now resolves: explicit style → inherited →
     keyword fallback. Deterministic, no LLM cooperation needed for
     follow-up edits on previously-generated images.

  2. System prompt: explicit three-step style resolution for
     edit_image. Generated by you → omit style and auto-inherit.
     Uploaded by user → INSPECT visually and pick a matching style
     (the LLM is the only thing with vision; the tool can't see
     pixels). Then keep that style for subsequent edits.

Both paths matter — the tool fix handles the common case
deterministically, the prompt fix handles the upload case where
there's nothing to inherit from.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
57_WolveandClaude Opus 4.7 committed 2026-04-19 15:31:57 -05:00
1 parent def27087c1
commit 6700f6ce33
3 files changed
+68 -4

No files matched your search

@@ -87,6 +87,19 @@ STYLES (pick one):
furry-il anthropomorphic, Illustrious base (default for any
furry/anthro request)
STYLE FOR edit_image — pick in this order:
- The image was generated by you earlier in this chat → omit `style`,
the tool auto-inherits from the previous call.
- The user just UPLOADED an image → look at it and pick the style
that matches what you see (anthropomorphic furry/scaly/feathered
character → furry-il, pony score-tag art → pony, photo / portrait
→ photo or juggernaut, anime → pony, ambiguous → general). Keep
using that style for subsequent edits in the same chat.
- Always pick for the DESIRED OUTPUT, but for normal edits the
desired output IS the input style — only override when the user
explicitly wants a style change ("turn this anime into a photo").
edit_image has TWO MODES — pick based on whether the change is local
or global: