QVAC-17304 feat[api]: add img2img support to SDK diffusion API#1662
Merged
maxim-smotrov merged 12 commits intoApr 22, 2026
Conversation
aegioscy
reviewed
Apr 20, 2026
aegioscy
reviewed
Apr 21, 2026
…and extract plugin mock into withMockDiffusionPlugin helper
lauripiisang
requested changes
Apr 21, 2026
lauripiisang
left a comment
Contributor
There was a problem hiding this comment.
can't be merged - test changes will crash mobile
…ile and desktop due to file system logic diff
simon-iribarren
approved these changes
Apr 22, 2026
lauripiisang
approved these changes
Apr 22, 2026
NamelsKing
previously approved these changes
Apr 22, 2026
NamelsKing
approved these changes
Apr 22, 2026
Contributor
Author
|
/review |
Contributor
Tier-based Approval Status |
Proletter
pushed a commit
that referenced
this pull request
May 24, 2026
* feat[api]: add img2img support to SDK diffusion API * fix(sdk): enforce img_cfg_scale default of -1 at the schema level * test(sdk): split sdcpp diffusion dispatcher tests into focused cases and extract plugin mock into withMockDiffusionPlugin helper * chore(test/diffusion): cleanup the comments * test: add diffusion img2img test definition with init_image param * fix(test/diffusion): split shared executor into separate ones for mobile and desktop due to file system logic diff --------- Co-authored-by: Simon Iribarren <simon.ig13@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What problem does this PR solve?
diffusion()API only supported txt2img — users could not use the img2img capability of the underlying diffusion add-on.📝 How does it solve it?
init_image(Uint8Array on the client, base64 on the wire),strength, andimg_cfg_scaletodiffusionRequestSchema.diffusion()acceptsinit_image: Uint8Arrayand base64-encodes it before sending; cross-runtimeencodeBase64helper added inutils/encoding.ts(usesbtoaso it works in Node, Bare, and React Native/Hermes).init_imageto aBufferand forwardsinit_image,strength, andimg_cfg_scaleto@qvac/diffusion-cpp.@qvac/diffusion-cppto^0.2.0(img2img-capable).🧪 How was it tested?
test/unit/sdcpp-plugin.test.tsexamples/diffusion-img2img.tsdemonstrating end-to-end usage.🔌 API Changes
Here's an example usage of the new img2img API.