Commit 01f8de32 authored by AUTOMATIC1111's avatar AUTOMATIC1111 Committed by GitHub

Merge pull request #334 from C43H66N12O12S2/channels-last

Channels last support
parents b70b51cc 8c995be4
......@@ -44,6 +44,7 @@ parser.add_argument("--hide-ui-dir-config", action='store_true', help="hide dire
parser.add_argument("--ui-settings-file", type=str, help="filename to use for ui settings", default=os.path.join(script_path, 'config.json'))
parser.add_argument("--gradio-debug", action='store_true', help="launch gradio with --debug option")
parser.add_argument("--gradio-auth", type=str, help='set gradio authentication like "username:password"; or comma-delimit multiple like "u1:p1,u2:p2,u3:p3"', default=None)
parser.add_argument("--channelslast", action='store_true', help="Enable Channels Last Memory Type")
cmd_opts = parser.parse_args()
......
......@@ -49,7 +49,8 @@ def load_model_from_config(config, ckpt, verbose=False):
if len(u) > 0 and verbose:
print("unexpected keys:")
print(u)
if cmd_opts.channelslast:
model = model.to(memory_format=torch.channels_last)
model.eval()
return model
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment