Skip to content

Commit

Permalink
unet conversion: add option to skip init check
Browse files Browse the repository at this point in the history
  • Loading branch information
catwell committed Jan 16, 2024
1 parent e1cc958 commit 37381d1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion scripts/conversion/convert_diffusers_unet.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Args(argparse.Namespace):
subfolder: str
half: bool
verbose: bool
skip_init_check: bool


def setup_converter(args: Args) -> ModelConverter:
Expand Down Expand Up @@ -49,7 +50,13 @@ def setup_converter(args: Args) -> ModelConverter:
"keyword": {"added_cond_kwargs": added_cond_kwargs} if source_has_time_ids else {},
}

converter = ModelConverter(source_model=source, target_model=target, skip_output_check=True, verbose=args.verbose)
converter = ModelConverter(
source_model=source,
target_model=target,
skip_init_check=args.skip_init_check,
skip_output_check=True,
verbose=args.verbose,
)
if not converter.run(
source_args=source_args,
target_args=target_args,
Expand Down Expand Up @@ -83,6 +90,11 @@ def main() -> None:
),
)
parser.add_argument("--subfolder", type=str, default="unet", help="Subfolder. Default: unet.")
parser.add_argument(
"--skip-init-check",
action="store_true",
help="Skip check that source and target have the same layers count.",
)
parser.add_argument("--half", action="store_true", help="Convert to half precision.")
parser.add_argument(
"--verbose",
Expand Down

0 comments on commit 37381d1

Please sign in to comment.