Skip to content

Inconsistent Input Handling in Forward Methods #20

@techexport

Description

@techexport

Description

The model's forward methods have inconsistent parameter handling across different implementations. In particular, ControlPixArtMSHalf_RelaCtrl implements a forward method that shadows the one from the parent class, but without proper handling of the c parameter when it's None.

Steps to Reproduce

In diffusion/model/nets/pixart_relactrl_v1.py, the forward method in ControlPixArtHalf_RelaCtrl handles conditioning properly:

def forward_c(self, c):
    # Properly process c if it's not None
    return self.x_embedder(c) + pos_embed if c is not None else c

While in ControlPixArtMSHalf_RelaCtrl, it seems to directly call forward_c(c) without checking if c is None first, which could lead to errors.

Proposed Solution

Ensure consistent parameter handling across all forward methods. Specifically:

  1. Make sure all inherited methods properly handle the case where c is None
  2. Add proper error handling and validation for input parameters
  3. Consider creating a standardized interface for all forward methods to ensure consistency

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions