Skip to content
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

implemented generic type validation for all nodes. #4149

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Commits on Jul 31, 2024

  1. implemented BHW3 compliance for IMAGE types for all nodes.

    This change transparently implements BHW3 compliance for IMAGE type inputs and outputs for all nodes. No changes need to be made to existing nodes, the conformance is applied before the IMAGE is passed into the node, and after it is passed out of the node. 
    
    This change was discussed on the #backend_developers discord with @comfyanonymous  and @mcmonkey4eva 
    
    More rigorous testing needs to be done to ensure that there are no egregious failure modes and that all formats are covered. 
    
    Im sure the `force_bhw3` function can also be made better, but this is currently a working implementation.
    shawnington authored Jul 31, 2024
    Configuration menu
    Copy the full SHA
    5749d34 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    40a86b3 View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2024

  1. Update cli_args.py

    added cli args --type-confromance with 3 options
    
    `all` - attempts to convert all values to the input/output types specified by the node
    
    `images` - only converts images to bwh3 format 
    
    `error` - raises an error if the type does not match what is specified. 
    
    `none` - prints error messages to console and does nothing else.
    shawnington authored Aug 2, 2024
    Configuration menu
    Copy the full SHA
    5c5a333 View commit details
    Browse the repository at this point in the history
  2. Update execution.py for flexible conformance handling.

    A validation generator function has been aded along with the ability to specify custom functions for validating individual types.
    
    cli args have been added in the form of 
    
    --type-conformance='arg'
    
    with the following args: 
    all : attempts to convert any mistyped inputs/outputs to the type specified by the node
    
    images : only enforces BHW3 on images, doing the minimum verifiably accurate transforms such as MASK HW and BHW to BHW3
    
    error: raises an error with information about the type mismatch at the node where it occurs.
    
    none: the default value, it outputs errors to console, and does nothing else. 
    
    This should address most of the areas of discussion.
    shawnington authored Aug 2, 2024
    Configuration menu
    Copy the full SHA
    593d69d View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2024

  1. Configuration menu
    Copy the full SHA
    6b36272 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d4ebb8f View commit details
    Browse the repository at this point in the history