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
|
metadata["modelspec.prediction_type"] = PRED_TYPE_EPSILON
|
||||||
|
|
||||||
if timesteps is not None:
|
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:
|
else:
|
||||||
del metadata["modelspec.timestep_range"]
|
del metadata["modelspec.timestep_range"]
|
||||||
|
|
||||||
|
|||||||
@@ -2546,15 +2546,15 @@ def get_sai_model_spec(
|
|||||||
lora,
|
lora,
|
||||||
textual_inversion,
|
textual_inversion,
|
||||||
timestamp,
|
timestamp,
|
||||||
title,
|
title=title,
|
||||||
reso,
|
reso=reso,
|
||||||
is_stable_diffusion_ckpt,
|
is_stable_diffusion_ckpt=is_stable_diffusion_ckpt,
|
||||||
args.metadata_author,
|
author=args.metadata_author,
|
||||||
args.metadata_description,
|
description=args.metadata_description,
|
||||||
args.metadata_license,
|
license=args.metadata_license,
|
||||||
args.metadata_tags,
|
tags=args.metadata_tags,
|
||||||
timesteps,
|
timesteps=timesteps,
|
||||||
args.clip_skip, # None or int
|
clip_skip=args.clip_skip, # None or int
|
||||||
)
|
)
|
||||||
return metadata
|
return metadata
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user