QVAC-17810 test[skiplog]: add img2img integration tests for diffusion#2241
Conversation
QVAC E2E —
|
QVAC E2E —
|
simon-iribarren
left a comment
There was a problem hiding this comment.
CI Status
Green. PR validation, SDK checks, build, desktop GPU lanes, Android, and iOS e2e are passing. Release/publish jobs are skipped as expected for PR context.
API Surface & Tagging
No public API changes detected. This is test coverage only, so test[skiplog] is appropriate and no [api], [bc], or [mod] tag is required.
Recommendation
Approve. The img2img coverage is scoped to desktop because mobile diffusion remains intentionally skipped for Device Farm memory pressure, which is fine for this PR.
Tier-based Approval Status |
1a385ee
Preview deployments for qvac-docs-staging ⚡️
Commit: Deployment ID: Static site name: |
1a385ee to
82a46f7
Compare
- New e2e cases in tests-qvac for the img2img path against real loaded diffusion models: img2img-vs-txt2img baseline (proves init_image changes output via byte-delta + IHDR-dimension comparison), img_cfg_scale acceptance, invalid-strength validation. Reuses the existing diffusion-basic-img2img case. - Platform split (matches vision tests): asset filename to Uint8Array resolution lives in desktop diffusion executor; shared executor only sees bytes and stays React Native-clean. - Skip all diffusion tests on mobile (SD 2.1 1B Q8_0 cold-load OOMs Device Farm devices, ~3GB); shorten SkipExecutor message; remove dead mobile diffusion executor and its consumer wiring (resource definition, executor handler, and SD_V2_1_1B_Q8_0 import). - Refactor shared diffusion executor to be a typed reference impl: drop execute() override in favour of an exhaustive handlers map (Required<...> mapped type — adding a test without a handler is a compile error), introduce DiffusionParams interface (no unknown/any), consolidate 4 near-duplicate handlers into runBasic(resourceKey, ...) via bind, extract compareWithBaseline + readPngDims/assertEqualPng Dimensions helpers (replaces brittle byte-length checks). - Add minimal 256x256 RGB PNG asset (562 B) to keep SD 2.1 output dims matching requested 256x256 and minimize resource cost. Co-authored-by: Cursor <cursoragent@cursor.com>
82a46f7 to
5678c06
Compare
|
/review |
🎯 What problem does this PR solve?
img2imgwas shipped to the SDK in QVAC-17304 feat[api]: add img2img support to SDK diffusion API #1662 buttests-qvaconly had unit/mock coverage; real integration coverage against loaded diffusion models was missing.tests-qvac/tests/shared/executors/diffusion-executor.tshad drifted: heavyif (testId === ...)branching,unknown/anyparams, ad-hoc PNG-size byte checks that produce false positives on compressed images.📝 How does it solve it?
diffusion-tests.tsexercising the img2img path against real loaded models:diffusion-img2img-vs-txt2img-baseline— provesinit_imageactually changes output (byte-delta + IHDR-dimension comparison vs txt2img baseline).diffusion-img2img-img-cfg-scale—img_cfg_scaleparameter accepted/rendered.diffusion-img2img-invalid-strength— Zod rejects out-of-rangestrength.diffusion-basic-img2img.Uint8Arrayresolution lives indesktop/executors/diffusion-executor.ts(Nodefs); shared executor stays React Native-clean and only sees bytes.SkipExecutormessage updated;mobile/executors/diffusion-executor.tsremoved as dead code.shared/executors/diffusion-executor.tsto be a typed reference implementation:execute()override; replaced with a strongly-typedhandlersmap.Required<{ [K in testId]: HandlerFn<…> }>annotation makes the map exhaustive at compile time — adding a new test without a handler is a TS error.DiffusionParamsinterface (no moreunknown/any);buildParams/resolveParamstyped end-to-end.runBasic(resourceKey, …)viabind.compareWithBaselinehelper for img2img-vs-txt2img and fusion-vs-flux2 comparisons.readPngDims/assertEqualPngDimensions(parse IHDR) so we no longer false-positive on compressed-byte length differences.assets/images/diffusion-img2img-source-256.png(562 B, 256×256 RGB) — keeps SD 2.1 output dimensions matching requested 256×256 and minimizes resource cost.🧪 How was it tested?
npm run install:build:full→ full diffusion suite green locally (FLUX 2 Klein).tsc --noEmitclean. Exhaustiveness check verified by removing a handler entry and confirming TS error:Property '"diffusion-standalone-upscaler-x4"' is missing in type … but required in type 'Required<…>'.