Feature(app): Add an endpoint to recall generation parameters #8758
+1,961
−12
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.
Summary
This PR adds a new route endpoint named
/api/v1/recallwhich updates the recallable image generation parameters with new values passed via a POST. The route then triggers the front end to load the updated values. This is intended to make it possible to integrate InvokeAI into desktop workflows where image generation parameters are stored in an external database. It also creates the foundation for remote-controlling the front end.Related Issues / Discussions
None.
QA Instructions
You can test this PR by sending the following requests to the back end and confirming that the frontend picks up and displays the changed parameters.
Basic Fields:
The full list of recallable parameters that can try for testing is here:
positive_promptnegative_promptmodelrefiner_modelvae_modelschedulerstepsrefiner_stepscfg_scalecfg_rescale_multiplierrefiner_cfg_scaleguidancewidthheightseeddenoise_strengthrefiner_denoise_startclip_skipseamless_xseamless_yrefiner_positive_aesthetic_scorerefiner_negative_aesthetic_scoreLoRA Models:
(Change the LoRA names as appropriate to what you have installed).
IP Adapters:
Currently you can only use images that have previously been uploaded or generated and are located in the
INVOKEAI/outputs/imagesdirectory.The API handles both ip_adapters and flux_redux models, even though they take different parameters (irrelevant parameters are ignored). This matches the behavior of the front end.
ControlNets
Again, you need to provide the name of an image that is already in the InvokeAI system. If no image name is provided, then the controlnet parameters will be loaded and the user can upload the image of their choice.
Full Description of the API
See
docs/contributing/RECALL_PARAMETERS/*.mdMerge Plan
Should be a simple merge.
Checklist
What's Newcopy (if doing a release after this PR)