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.
This commit is contained in:
DenOfEquity
2024-09-10 14:39:53 +01:00
committed by GitHub
parent c13b26ba27
commit 720b80daea

View File

@@ -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)