modifiable params
This commit is contained in:
@@ -24,8 +24,8 @@ class FlexMaskBase(FlexBase, MaskBase):
|
||||
|
||||
# Add feature-specific inputs
|
||||
required.update({
|
||||
"feature": ("FEATURE",),
|
||||
"feature_pipe": ("FEATURE_PIPE",),
|
||||
"feature_param": (cls.get_modifiable_params(),),
|
||||
"feature_mode": (["relative", "absolute"], {"default": "relative"}),
|
||||
})
|
||||
|
||||
# Merge optional inputs
|
||||
@@ -48,6 +48,12 @@ class FlexMaskBase(FlexBase, MaskBase):
|
||||
FlexBase.__init__(self)
|
||||
MaskBase.__init__(self)
|
||||
|
||||
@classmethod
|
||||
@abstractmethod
|
||||
def get_modifiable_params(cls):
|
||||
"""Return a list of parameter names that can be modulated."""
|
||||
return ["None"]
|
||||
|
||||
@abstractmethod
|
||||
def process_mask(self, mask: np.ndarray, feature_value: float, strength: float, **kwargs) -> np.ndarray:
|
||||
"""Process a single mask with feature modulation.
|
||||
|
||||
@@ -295,10 +295,10 @@ class FlexMaskBinary(FlexMaskBase):
|
||||
|
||||
def main_function(self, masks, feature, feature_pipe, strength, feature_threshold, mask_strength, invert, subtract_original, grow_with_blur, **kwargs):
|
||||
# Call the parent class's apply_mask_operation with all parameters
|
||||
return self.apply_mask_operation(
|
||||
return (self.apply_mask_operation(
|
||||
masks, feature, feature_pipe, strength, feature_threshold, mask_strength,
|
||||
invert, subtract_original, grow_with_blur, **kwargs
|
||||
)
|
||||
),)
|
||||
|
||||
class FlexMaskWavePropagation(FlexMaskBase):
|
||||
@classmethod
|
||||
@@ -399,10 +399,10 @@ class FlexMaskWavePropagation(FlexMaskBase):
|
||||
|
||||
def main_function(self, masks, feature, feature_pipe, strength, feature_threshold, mask_strength, invert, subtract_original, grow_with_blur, **kwargs):
|
||||
# Call the parent class's apply_mask_operation with all parameters
|
||||
return self.apply_mask_operation(
|
||||
return (self.apply_mask_operation(
|
||||
masks, feature, feature_pipe, strength, feature_threshold, mask_strength,
|
||||
invert, subtract_original, grow_with_blur, **kwargs
|
||||
)
|
||||
),)
|
||||
|
||||
class FlexMaskEmanatingRings(FlexMaskBase):
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user