You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Root cause: The /internal/files/{directory_type} endpoint in api_server/routes/internal/internal_routes.py (line 70) returned plain filenames like image.png. However, LoadImageOutput inherits from LoadImage, which uses folder_paths.get_annotated_filepath() and folder_paths.exists_annotated_filepath() to resolve file paths. These functions rely on a [directory_type] suffix convention (e.g., image.png [output]) to determine which directory to look in.
Without the annotation, the system defaulted to looking in the input directory instead of the output directory, so:
The frontend built incorrect preview URLs (type=input instead of type=output), causing 404 errors
VALIDATE_INPUTS couldn't find the file in the input folder, causing validation failures
Fix
Changed the response format in api_server/routes/internal/internal_routes.py line 70 from:
This appends the directory type annotation (e.g., [output], [input], [temp]) to each filename, allowing annotated_filepath() in folder_paths.py to correctly resolve the file to the right directory.
The change modifies the /internal/files/{directory_type} endpoint to alter its response format. Instead of returning only each visible file's name, the endpoint now returns a list of strings formatted as "{entry.name} [{directory_type}]". All existing functionality is preserved, including filtering of non-hidden files, sorting by descending modification time, and validation and error handling for the directory_type parameter.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
⚠️ Warning
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%.
Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name
Status
Explanation
Linked Issues check
✅ Passed
The PR directly addresses issue #13078 by implementing the exact fix proposed: appending [directory_type] suffix to filenames so the endpoint returns annotated filepaths.
Out of Scope Changes check
✅ Passed
The PR contains only the single, focused change to the response format of the /internal/files/{directory_type} endpoint, directly addressing the linked issue with no extraneous modifications.
Description check
✅ Passed
The PR description clearly explains the problem, root cause, and solution related to the endpoint changes.
Title check
✅ Passed
The title accurately describes the main change: appending directory type annotation to the internal files endpoint response, which is the core fix addressing the issue.
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Abdulrehman-PIAIC80387
changed the title
fix: append directory type annotation to internal files endpoint resp…
fix: append directory type annotation to internal files endpoint
Apr 6, 2026
Hi, just checking in — this is a small one-line fix for #13078 which multiple users have confirmed works. Would appreciate a review when you get a chance. Thanks!
alexisrolland
changed the title
fix: append directory type annotation to internal files endpoint
fix: append directory type annotation to internal files endpoint (CORE-71)
Apr 18, 2026
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
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 #13078
Problem
The
Load Image (from Outputs)node was completely broken — selecting any image from the dropdown resulted in:Root cause: The
/internal/files/{directory_type}endpoint inapi_server/routes/internal/internal_routes.py(line 70) returned plain filenames likeimage.png. However,LoadImageOutputinherits fromLoadImage, which usesfolder_paths.get_annotated_filepath()andfolder_paths.exists_annotated_filepath()to resolve file paths. These functions rely on a[directory_type]suffix convention (e.g.,image.png [output]) to determine which directory to look in.Without the annotation, the system defaulted to looking in the input directory instead of the output directory, so:
type=inputinstead oftype=output), causing 404 errorsVALIDATE_INPUTScouldn't find the file in the input folder, causing validation failuresFix
Changed the response format in
api_server/routes/internal/internal_routes.pyline 70 from:to:
This appends the directory type annotation (e.g.,
[output],[input],[temp]) to each filename, allowingannotated_filepath()infolder_paths.pyto correctly resolve the file to the right directory.