From 720b80daea9070aa7896d8ce2c4a6cf8daf927cf Mon Sep 17 00:00:00 2001 From: DenOfEquity <166248528+DenOfEquity@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:39:53 +0100 Subject: [PATCH] force clipskip to int (#1775) #1760, original solution by cmdr2. extended to 2 other locations where setting is read. I could replicate the issue only by manually entering a decimal value. Possibly also #1764. Though I don't know how the clipskip setting became a string. --- modules/processing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/processing.py b/modules/processing.py index e6ebb6c7..45b6a0df 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -465,7 +465,7 @@ class StableDiffusionProcessing: cache = caches[0] with devices.autocast(): - shared.sd_model.set_clip_skip(opts.CLIP_stop_at_last_layers) + shared.sd_model.set_clip_skip(int(opts.CLIP_stop_at_last_layers)) cache[1] = function(shared.sd_model, required_prompts, steps, hires_steps, shared.opts.use_old_scheduling) @@ -542,7 +542,7 @@ class Processed: self.index_of_first_image = index_of_first_image self.styles = p.styles self.job_timestamp = state.job_timestamp - self.clip_skip = opts.CLIP_stop_at_last_layers + self.clip_skip = int(opts.CLIP_stop_at_last_layers) self.token_merging_ratio = p.token_merging_ratio self.token_merging_ratio_hr = p.token_merging_ratio_hr @@ -714,7 +714,7 @@ def create_infotext(p, all_prompts, all_seeds, all_subseeds, comments=None, iter if all_negative_prompts is None: all_negative_prompts = p.all_negative_prompts - clip_skip = getattr(p, 'clip_skip', opts.CLIP_stop_at_last_layers) + clip_skip = int(getattr(p, 'clip_skip', opts.CLIP_stop_at_last_layers)) enable_hr = getattr(p, 'enable_hr', False) token_merging_ratio = p.get_token_merging_ratio() token_merging_ratio_hr = p.get_token_merging_ratio(for_hr=True)