-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Internal download API: Add proper validated directory input #4981
Internal download API: Add proper validated directory input #4981
Conversation
returns a json maps of folder paths
to avoid compounding errors from network failure
tests are failing because |
This test fails because you deleted one argument in the function definition. |
funny timing you comment right when I finally get past the thing blocking me - overwriting |
There will be a set of tests that fail on Windows FYI if you are testing locally. Trying to fix those here |
Tests for this PR are now fully passing (not counting the stuff that fails on windows, thank you robin for fixing those!) |
use temp dir to avoid accidental fs pollution from tests
Fails frontend test
|
This is the core side internal update for a frontend PR: Comfy-Org/ComfyUI_frontend#890
Frontend PR depends also on #4980 which I separated for cleanliness (that one is a decent miniapi and can be pulled no problem, whereas this is a much larger change that may need some figuring out first)
Key point is where the old code had a loose vague directory input that could be anything but had to be relative to the base, the new code accepts a pair of values that must match what
folder_paths
already manages.That is: a directory (eg
checkpoints
), and a path for an instance of that directory (egC:/path/to/ComfyUI/models/checkpoints
)The matching frontend PR for this internal API will display the list of locations if there are multiple, or just select the main one if there's only one. (There's usually multiple though even on clean installs).
Because it's strictly whitelist matched against data the server already knows, this simplifies validation.
I also cleared out some redundant variables that weren't needed before and don't even make sense now (
relative_path
was never used)