-
Notifications
You must be signed in to change notification settings - Fork 447
[backport core/1.33] Fix workflow loading from PNG images with both workflow and parameter… #7265
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
Conversation
#7154) …s metadata - Reorder handleFile() to check workflow before parameters - Add validation to prevent JSON parse errors from crashing imports - Fix loadGraphData() to use explicit type validation instead of falsy check - Ensures ComfyUI-generated PNGs with both metadata types load the workflow, not parameters Fixes issue where large workflows (e.g., 634 nodes) were replaced with basic A1111 format when importing PNG files. ## Summary Fixed workflow loading from PNG images to prioritize workflow metadata over parameters, preventing large workflows from being replaced with basic A1111 format. ## Changes - **What**: Reordered `handleFile()` to check workflow before parameters, added JSON parse error handling and validation, fixed `loadGraphData()` to use explicit type checking instead of falsy check - **Dependencies**: None ## Review Focus The key issue was in `handleFile()` where parameters were checked before workflow, causing ComfyUI-generated PNGs (which contain both workflow and parameters metadata) to incorrectly import as A1111 format. The fix ensures: 1. Workflow is always checked first and validated properly 2. Parameters are only used as a fallback when no workflow exists 3. Invalid/malformed workflow data doesn't crash the import process Additionally, `loadGraphData()` was using a falsy check (`if (!graphData)`) which could incorrectly replace valid but falsy values. Now uses explicit type validation. Tested with real-world PNG containing 634-node workflow (780KB) + parameters (1KB) - now correctly loads the workflow instead of discarding it. <!-- Fixes #ISSUE_NUMBER --> ## Screenshots (if applicable) N/A - Backend logic fix, no UI changes Fixes #6633 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7154-Fix-workflow-loading-from-PNG-images-with-both-workflow-and-parameter-2bf6d73d365081ecb7a6c4bf6b6ccd51) by [Unito](https://www.unito.io) --------- Co-authored-by: Alexander Brown <[email protected]> Co-authored-by: Alexander Brown <[email protected]>
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 12/09/2025, 12:55:54 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Test Results❌ Some tests failed ⏰ Completed at: 12/09/2025, 01:04:42 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
🔧 Auto-fixes AppliedThis PR has been automatically updated to fix linting and formatting issues.
Changes made:
|
Backport of #7154 to
core/1.33Automatically created by backport workflow.
┆Issue is synchronized with this Notion page by Unito