Image Edit Feature (Fixes #1352) #1439
Conversation
There was a problem hiding this comment.
Pull request overview
Adds image edit (and variation-from-reference) support to the Electron/web app by wiring the UI to the server’s /images/edits (and /images/variations) endpoints, and updates the sd-server backend behavior for variations to use the edits endpoint with embedded inference parameters.
Changes:
- Update
SDServer::image_variationsto forward to sd-server’s/v1/images/editsand embedsteps/cfg_scalevia<sd_cpp_extra_args>. - Extend the Image Generation panel UI with mode selection, reference-image upload/preview, and new “Edit” / “Variations” actions on generated images.
- Add/adjust CSS for new image action buttons and reference upload UI; update
package-lock.json.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/cpp/server/backends/sd_server.cpp | Changes variations forwarding behavior and prompt construction for sd-server multipart requests. |
| src/app/src/renderer/components/panels/ImageGenerationPanel.tsx | Adds image edit/variation workflows, reference image handling, and updated send/save behavior. |
| src/app/styles.css | Introduces styles for new image action buttons and reference upload UI. |
| src/app/package-lock.json | Lockfile update (adds transitive dependency metadata). |
Files not reviewed (1)
- src/app/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- src/app/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@Phqen1x I tried using this in the webapp, I am using SD-Turbo and when I provide a prompt with an image to edit I am seeing a new image being generated rather than the passed image being edited. See below:
|
I've run into this as well, but at the time I just assumed it was because the model I was accidentally using, SD-1.5, was simply too small and not powerful enough to do a good job. I just asked Claude what it thought was the issue, and it believes that the reason is because sd-server maybe uses different endpoints for reference images that isn't being used here. I am not really sure how to find what endpoint in sd-server needs to be used for the SD-Turbo, SDXL-Turbo, and other SD models to work. I know the Flux-2-Klein models do work, though. |
If the issue lies in sd-server endpoints that are not implemented/unsupported, you can probably place a proxy in between the image editor and backend to capture the exact payload the editor is sending to sd-server in order to debug. Additionally, look for errors in the backend with debug logs enabled ( I had to do this to reverse engineer/implement the requests claude code was sending via Anthropic's Messages API to the llamacpp backend. I can share the script I used for the proxy if you are interested. |
I would appreciate if you could send that script! Thanks for the input, Sawan. |
Here you go! |
|
We could add an edit label to server_models.json and disable the edit UI for non-editing models. So users dont fail by trying SD models. |
I like that solution, surely this isn't the only case that will bite us. |
|
@Phqen1x let me know if you want to discuss this further. Really looking forward to the feature :) |
Definitely! The edit label sounds like a great idea. I can work on implementing an edit label and integrating that into this feature tomorrow! I'll let you know if I have any other questions or comments. |
|
@ramkrishna2910, just implemented the edit label and applied it to the Flux-2-Klein models. None of the other image models included in Lemonade seem to be capable of image editing at this time. It might be nice to display the edit label in the model manager, but we're not displaying anything for the SD models now anyway. Maybe we can do that as a followup PR. |
|
Yup makes sense. I will take a look at this shortly. :) |
ramkrishna2910
left a comment
There was a problem hiding this comment.
Great contribution! Super excited for this feature to ship!
|
Glad to hear it! Can't wait to see it shipped as well! |





I have added functionality to the electron app/webapp to use the /edits endpoint built into lemonade-server. Now the image generator panel has the ability to edit reference images as well using a prompt.