Repository navigation
Unsloth Studio / Desktop: the Images page Compare grid, for API callers (server-rendered X/Y grid, no UI change) - #15169
Conversation
… gallery, labelled grid image) POST /images/generate takes an optional xy spec: up to two axes over an allowlist of request fields (seed, steps, guidance, sampler, schedule_type, shift, base/max shift, strength, clip_skip, cfg_rescale, variation seed and strength, a LoRA weight by index, Prompt S/R). The server expands the cells, validates each as a full generate request, renders them on one shared seed, saves each to the gallery with its own recipe and saves one labelled grid PNG, returned as grid. 64 cells max, the Images page Compare grid's cap.
# Conflicts: # studio/backend/models/inference.py # studio/backend/routes/inference.py
|
The The check reads |
# Conflicts: # studio/frontend/src/features/images/api.ts
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
… order cells by active adapters, and stop queued cells [skip ci]
…and drop parsed zero-weight LoRAs [skip ci]
…s saved [skip ci]
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Part of #10695.
This is the API version of a feature the Images page already has. In the app, Images > Create > Compare grid (#14624) already varies two settings and lays the results out as a grid; this PR adds no button and changes nothing in the UI. What it adds is the same grid for anything that is not the browser:
POST /api/inference/images/generatetakes an optionalxyspec and the server renders the cells and composes the labelled grid. Leavexyout and the request runs exactly as on main; the response only gains two empty fields,grid: nulland, on each gallery record,xy_grid: null.Why it is worth having next to Compare: Compare renders in the browser, so scripts and other API clients can't use it, and its grid PNG is download-only. Here the grid and every cell land in the gallery with their own recipes.
Changes in this PR
xyis optional: up to two axes, each a field and a list of values. Axis fields are an allowlist: seed, steps, guidance, sampler, schedule_type, shift, base_shift, max_shift, strength, clip_skip, cfg_rescale, variation_seed, variation_strength, a LoRA weight by index, and Prompt S/R. 64-cell cap, same as Compare.grid, on top of the cells, not instead of them.POST /images/generate/cancelreportscancelled: truefor it.width/heightand addsxy_grid.cell_width/cell_height; reusing the grid's settings on the Images page restores the cell size instead of the grid's.Test matrix
3879b435a04ef7xyignored, one image (byte-identical to the steps 8 / guidance 0 cell)3879b43test_diffusion_xy.py, frontend parity test, typecheckScreenshots
The existing in-app way, unchanged by this PR: the Compare grid switch at the bottom of the Create panel.
The API request and the grid it returned:
That grid saved to the gallery, with the 9 cells beside it as normal images:
Not tested
Branch merged with main at
b6fc821; tests and typecheck rerun after the merge. Thetest_diffusion_routes.pyfailures (6,cancel_generate() ... expected_account) fail identically on mainb6fc821.Restore these settings on a grid image (before / after)
A grid image seeded into the gallery as /images/generate saves it (2880x2441 grid of 768x768 cells), then Recipe > Restore these settings. Before, the size controls take a size scaled from the grid; after, the cell size.