Security Fix #89
Closed
ash-bluepollution95
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
PR: Major Overhaul - Parsing, Stability, UI, Security, and Docs
Closes:
#(issue_number_1),#(issue_number_2)(Optional: Link to any issues this PR resolves)This pull request introduces a significant set of improvements and features, representing a substantial leap forward in the development of Dataset-Tools. It focuses on enhancing core stability, overhauling the metadata parsing pipeline, adding key usability features like drag-and-drop, integrating new custom parsers, and updating project documentation for clarity and accuracy.
⚡ Key Highlights & New Features
RuinedFooocusFormat: Added support for RuinedFooocus JSON metadata.CivitaiComfyUIFormat: Added support for Civitai's ComfyUI-based UserComment metadata, including mojibake decoding.Enabled GGUFParser: Basic metadata extraction from.ggufmodel files is now functional.sd-prompt-readercomponents for better status handling, error reporting, and integration.defusedxml.README.mdandSECURITY.MDhave been overhauled;NOTICE.mdadded for vendored code attribution.🐛 Core Stability & Bug Fixes
ModuleNotFoundError,NameError) acrossui.py,logger.py,correct_types.py, andvendored_sdpr/*by correcting import paths and resolving circular dependencies.AttributeError: 'str' object has no attribute 'value'by refactoringEmptyField,UpField,DownFieldincorrect_types.pyto be properenum.Enumclasses. UI and parsers now correctly use.valueandget_ordered_labels().AttributeErrorinwidgets.pyrelated toExtensionTypeby using correct attribute names (e.g.,SCHEMA_FILES,MODEL_FILES).TypeErrorfor parser__init__calls (e.g., forA1111) inImageDataReaderby ensuring passed arguments match parser signatures.ValueError: not enough values to unpackinA1111._sd_format()by correcting regex match unpacking.NameError: name 'Path' is not definedinImageDataReaderby adding thepathlib.Pathimport.F811 Redefinition of unused __init__inaccess_disk.py.F821 Undefined name tracebackinaccess_disk.pyby importingtraceback.⚙️ Vendored SD-Prompt-Reader Enhancements & Fixes
ImageDataReader._try_parser()helper for clearer instantiation and more robust status checking of individual format parsers.ImageDataReader.statusis accurately updated based on the success/failure of sub-parsers, resolving previously misleadingFORMAT_ERRORreports.A1111._process()now reliably sets its own success/failure status).vendored_sdprcomponents to use the"DSVendored_SDPR"prefix.vendored_sdpr/format/utility.pyto essential functions, removing unused GUI dependencies.defusedxmlfor safer XML parsing inImageDataReader(for DrawThings XMP data), addressing Bandit-flagged vulnerabilities (B408, B318). Addeddefusedxmlas a project dependency.✨ New Parser Integrations
(Covered in Key Highlights)
🎨 Code Quality & Linting (Ruff)
Applied extensive linting fixes across the codebase using Ruff (
ruff format .andruff check . --fix):E701,E702,E703style issues (multiple statements per line, semicolons).F401(unused imports) andF841(unused local variables) after careful review.F403/F405related to star imports.E741(ambiguous variable names).E722(bareexcept).F541(f-strings without placeholders).These changes significantly improve code readability, maintainability, and adherence to PEP 8.
🔊 Logging System Improvements
WARNINGinmain.pyregarding logger reconfiguration by aligning the function call toreconfigure_all_loggers. CLI log level setting is now fully effective.📚 Documentation & Project Files
README.md: Overhauled with details on new features (drag & drop, new parsers), revised installation instructions (reflectingpyproject.toml), updated license information, and improved overall structure and formatting.SECURITY.md: Updated to be more user-friendly, clearly state the project's GPL-3.0 license, define support for the current main branch, and list security tools now in use (pip-audit, Bandit, Ruff).NOTICE.md: Created to provide proper attribution and license information for vendored code, particularly the MIT-licensed components fromsd-prompt-reader.🔬 Testing Notes (Brief)
👀 Areas for Particular Review (Optional)
__init__signatures forNovelAI(info=...)andComfyUI(info=...)calls withinImageDataReader.py(regardingwidth/heightarguments) to ensure they match the actual definitions in those parsers.metadata_parser.py'smake_paired_str_dictfor diverse A1111 settings strings (this is an ongoing refinement).vendored_sdpr/format/comfyui.pyfor correctness and completeness with varied workflows.What's Changed
Full Changelog: 0.58.2.1...0.58.5
This discussion was created from the release Security Fix.
All reactions