Update sdxl_gen_img.py

This commit is contained in:
DKnight54
2025-01-24 02:37:59 +08:00
committed by GitHub
parent 6231883ef6
commit 3ca8dc51e9

View File

@@ -1492,8 +1492,9 @@ def main(args):
args.ckpt = files[0]
device = get_preferred_device()
logger.info(f"preferred device: {device}")
model_dtype = sdxl_train_util.match_mixed_precision(args, dtype)
(_, text_encoder1, text_encoder2, vae, unet, _, _) = sdxl_train_util._load_target_model(
args.ckpt, args.vae, sdxl_model_util.MODEL_VERSION_SDXL_BASE_V1_0, dtype, device
args.ckpt, args.vae, sdxl_model_util.MODEL_VERSION_SDXL_BASE_V1_0, dtype, device, model_dtype
)
unet: InferSdxlUNet2DConditionModel = InferSdxlUNet2DConditionModel(unet)
text_encoder1.to(dtype).to(device)
@@ -3194,6 +3195,10 @@ def setup_parser() -> argparse.ArgumentParser:
help="unsharp mask parameters for Gradual Latent: ksize, sigma, strength, target-x (1 means True). `3,0.5,0.5,1` or `3,1.0,1.0,0` is recommended /"
+ " Gradual Latentのunsharp maskのパラメータ: ksize, sigma, strength, target-x. `3,0.5,0.5,1` または `3,1.0,1.0,0` が推奨",
)
parser.add_argument("--full_fp16", action="store_true", help="Loading model in fp16")
parser.add_argument(
"--full_bf16", action="store_true", help="Loading model in bf16"
)
# # parser.add_argument(
# "--control_net_image_path", type=str, default=None, nargs="*", help="image for ControlNet guidance / ControlNetでガイドに使う画像"