-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(ui): async batch generators & board -> image generator #7685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
hipsterusername
approved these changes
Feb 26, 2025
This fixes the broken readiness checks introduced in the previous commit. To support async batch generators, all of the validation of the generators needs to be async. This is problematic because a lot of the validation logic was in redux selectors, which are necessarily synchronous. To resolve this, the readiness checks and related logic are restructured to be run async in response to redux state changes via `useEffect` (another option is to directly subscribe to redux store). These async functions then set some react state. The checks are debounced to prevent thrashing the UI. See #7580 for more context about this issue. Other changes: - Fix a minor issue where empty collections were also checked against their min and max sizes, and errors were shown for all the checks. If a collection is empty, we don't need to do the min/max checks. If a collection is empty, we skip the other min/max checks and do not report those errors to the user. - When a field is connected, do not attempt to check its value. This fixes an issue where collection fields with a connection could erroneously appear to be invalid. - Improved error messages for batch nodes.
The method and route now supports: - "none" as a board ID, sentinel value for uncategorized - Optionally specify image categories - Optionally specify is_intermediate
…ndpoint The functionality is the same - just need to explicitly opt out of categories and is_intermediate constraints.
This was a half-baked attempt to work around the issue with async generator nodes. It's not needed; the values are never referenced.
Not sure why I had this only checking if the size was >1. Doesn't make sense...
86b2ef7
to
f762776
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
api
frontend
PRs that change frontend files
invocations
PRs that change invocations
python
PRs that change python files
services
PRs that change app services
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
Fixes the issues described in #7580, which enables the Dynamic Prompts string batch generators (previously disabled) and a generators that gets all images for a board.
The generator required a change to the boards router and services. We need to efficiently get a list of image names for all images or assets on a board, with no intermediates. The existing endpoint got both images and assets, and included intermediates. It is updated to get the data needed.
This API chane is similar to the one in #7682, but it doesn't get the full image DTO. Just image names - so no URLs need to be generated and the response is much smaller.
Related Issues / Discussions
Fixes issues described in #7580
QA Instructions
Merge Plan
n/a
Checklist
What's New
copy (if doing a release after this PR)