Skip to content

feat: add image-to-image generation via reference image attachment#48

Open
tomasmach wants to merge 4 commits into
mainfrom
feat/image-reference
Open

feat: add image-to-image generation via reference image attachment#48
tomasmach wants to merge 4 commits into
mainfrom
feat/image-reference

Conversation

@tomasmach

Copy link
Copy Markdown
Owner

Summary

  • Adds use_reference_image tool parameter so the LLM can signal image-to-image generation when the user attaches an image
  • New img2img_model config field (global + per-agent) selects the fal.ai endpoint (fal-ai/flux/dev/image-to-image by default)
  • Agent now extracts the first downloaded image attachment as the reference URL and passes it into ImageGenDeps before building the tool registry
  • Web API (GET/PUT /api/config/image) and dashboard UI expose the new img2img_model field

Test plan

  • All existing tests pass (go test -tags sqlite_fts5 ./...)
  • TestImageGenImg2ImgWithReference — verifies img2img endpoint, image_url, strength=0.85, steps=28
  • TestImageGenImg2ImgWithoutReference — verifies graceful fallback to text-to-image when no reference URL is available
  • TestImageGenNoReferenceFlag — verifies text-to-image is used when flag is false even if reference URL is present
  • Manual: attach an image in Discord, ask "generate an image like this but as anime" → bot calls generate_image with use_reference_image: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant