Reverse T2IAdapter weights to account for ComfyUI changes (means SDXL T2IAdapter softweights have breaking changes due to extra middle weight)
This commit is contained in:
@@ -116,6 +116,7 @@ class T2IAdapterAdvanced(T2IAdapter, AdvancedControlBase):
|
||||
raw_weights = [(self.weights.base_multiplier ** float(7 - i)) for i in range(8)]
|
||||
raw_weights = [raw_weights[-8], raw_weights[-3], raw_weights[-2], raw_weights[-1]]
|
||||
raw_weights = get_properly_arranged_t2i_weights(raw_weights)
|
||||
raw_weights.reverse() # need to reverse to match recent ComfyUI changes
|
||||
return self.weights.copy_with_new_weights(raw_weights)
|
||||
|
||||
def get_calc_pow(self, idx: int, layers: int) -> int:
|
||||
|
||||
@@ -198,6 +198,7 @@ class SoftT2IAdapterWeights:
|
||||
uncond_multiplier: float=1.0, cn_extras: dict[str]={}):
|
||||
weights = [weight_00, weight_01, weight_02, weight_03]
|
||||
weights = get_properly_arranged_t2i_weights(weights)
|
||||
weights.reverse() # to account for recent ComfyUI changes
|
||||
weights = ControlWeights.t2iadapter(weights, flip_weights=flip_weights, uncond_multiplier=uncond_multiplier, extras=cn_extras)
|
||||
return (weights, TimestepKeyframeGroup.default(TimestepKeyframe(control_weights=weights)))
|
||||
|
||||
@@ -229,5 +230,6 @@ class CustomT2IAdapterWeights:
|
||||
uncond_multiplier: float=1.0, cn_extras: dict[str]={}):
|
||||
weights = [weight_00, weight_01, weight_02, weight_03]
|
||||
weights = get_properly_arranged_t2i_weights(weights)
|
||||
weights.reverse() # to account for recent ComfyUI changes
|
||||
weights = ControlWeights.t2iadapter(weights, flip_weights=flip_weights, uncond_multiplier=uncond_multiplier, extras=cn_extras)
|
||||
return (weights, TimestepKeyframeGroup.default(TimestepKeyframe(control_weights=weights)))
|
||||
|
||||
Reference in New Issue
Block a user