diff --git a/modules/processing_helpers.py b/modules/processing_helpers.py index 486dc09a5..110b32b93 100644 --- a/modules/processing_helpers.py +++ b/modules/processing_helpers.py @@ -351,11 +351,10 @@ def validate_sample(tensor): cast = sample.astype(np.uint8) if len(w) > 0: nans = np.isnan(sample).sum() - shared.log.error(f'Failed to validate samples: sample={sample.shape} invalid={nans}') cast = np.nan_to_num(sample) minimum, maximum, mean = np.min(cast), np.max(cast), np.mean(cast) cast = cast.astype(np.uint8) - shared.log.warning(f'Attempted to correct samples: min={minimum:.2f} max={maximum:.2f} mean={mean:.2f}') + shared.log.error(f'Failed to validate samples: sample={sample.shape} min={minimum:.2f} max={maximum:.2f} mean={mean:.2f} invalid={nans}') return cast diff --git a/modules/sd_models.py b/modules/sd_models.py index bfcd7a0e2..3146b4c2a 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -1296,8 +1296,7 @@ def switch_pipe(cls: diffusers.DiffusionPipeline, pipeline: diffusers.DiffusionP def clean_diffuser_pipe(pipe): - n = getattr(pipe.__class__, '__name__', '') - if 'StableDiffusionXL' in n and 'requires_aesthetics_score' in pipe.config and hasattr(pipe, '_internal_dict'): + if pipe is not None and shared.sd_model_type == 'sdxl' and 'requires_aesthetics_score' in pipe.config and hasattr(pipe, '_internal_dict'): # diffusers adds requires_aesthetics_score with img2img and complains if requires_aesthetics_score exist in txt2img internal_dict = dict(pipe._internal_dict) # pylint: disable=protected-access internal_dict.pop('requires_aesthetics_score', None)