Merge pull request #4930 from QualiaRain/fix/runtime-and-detect-guards

fix(runtime): capture bias dtype cast, coerce env seq-len to int, init pipeline before use
This commit is contained in:
Vladimir Mandic
2026-06-16 08:36:11 +02:00
committed by GitHub
3 changed files with 3 additions and 2 deletions
+1
View File
@@ -187,6 +187,7 @@ def guess_by_diffusers(fn, current_guess):
cls = index.get('_class_name', None)
if isinstance(cls, list):
cls = cls[-1]
pipeline = None
if cls is not None:
pipeline = getattr(diffusers, cls, None)
if pipeline is None:
+1 -1
View File
@@ -84,7 +84,7 @@ def torch_conv_forward(self, input, weight, bias): # pylint: disable=redefined-b
if self.padding_mode != 'zeros':
return F.conv2d(F.pad(input, self._reversed_padding_repeated_twice, mode=self.padding_mode), weight, bias, self.stride, _pair(0), self.dilation, self.groups) # pylint: disable=protected-access
if weight.dtype != bias.dtype:
bias.to(weight.dtype)
bias = bias.to(weight.dtype)
return F.conv2d(input, weight, bias, self.stride, self.padding, self.dilation, self.groups)
def hijack_torch_conv():
+1 -1
View File
@@ -8,7 +8,7 @@ def hijack_encode_prompt(*args, **kwargs):
jobid = shared.state.begin('TE Encode')
t0 = time.time()
if 'max_sequence_length' in kwargs and kwargs['max_sequence_length'] is not None:
kwargs['max_sequence_length'] = max(kwargs['max_sequence_length'], os.environ.get('MAX_SEQUENCE_LENGTH', 256))
kwargs['max_sequence_length'] = max(kwargs['max_sequence_length'], int(os.environ.get('MAX_SEQUENCE_LENGTH', 256)))
res = None
try:
args_copy = list(args)