mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-09 06:45:09 +00:00
fix crashing in saving lora with clipskip
This commit is contained in:
@@ -215,7 +215,11 @@ def build_metadata(
|
||||
metadata["modelspec.prediction_type"] = PRED_TYPE_EPSILON
|
||||
|
||||
if timesteps is not None:
|
||||
metadata["modelspec.timestep_range"] = timesteps
|
||||
if isinstance(timesteps, str) or isinstance(timesteps, int):
|
||||
timesteps = (timesteps, timesteps)
|
||||
if len(timesteps) == 1:
|
||||
timesteps = (timesteps[0], timesteps[0])
|
||||
metadata["modelspec.timestep_range"] = f"{timesteps[0]},{timesteps[1]}"
|
||||
else:
|
||||
del metadata["modelspec.timestep_range"]
|
||||
|
||||
|
||||
@@ -2546,15 +2546,15 @@ def get_sai_model_spec(
|
||||
lora,
|
||||
textual_inversion,
|
||||
timestamp,
|
||||
title,
|
||||
reso,
|
||||
is_stable_diffusion_ckpt,
|
||||
args.metadata_author,
|
||||
args.metadata_description,
|
||||
args.metadata_license,
|
||||
args.metadata_tags,
|
||||
timesteps,
|
||||
args.clip_skip, # None or int
|
||||
title=title,
|
||||
reso=reso,
|
||||
is_stable_diffusion_ckpt=is_stable_diffusion_ckpt,
|
||||
author=args.metadata_author,
|
||||
description=args.metadata_description,
|
||||
license=args.metadata_license,
|
||||
tags=args.metadata_tags,
|
||||
timesteps=timesteps,
|
||||
clip_skip=args.clip_skip, # None or int
|
||||
)
|
||||
return metadata
|
||||
|
||||
|
||||
Reference in New Issue
Block a user