mirror of
https://github.com/lllyasviel/ControlNet.git
synced 2026-04-24 03:00:54 -04:00
i
This commit is contained in:
@@ -10,12 +10,22 @@ import os
|
||||
assert os.path.exists(path_sd15), 'Input path_sd15 does not exists!'
|
||||
assert os.path.exists(path_sd15_with_control), 'Input path_sd15_with_control does not exists!'
|
||||
assert os.path.exists(path_input), 'Input path_input does not exists!'
|
||||
assert not os.path.exists(path_output), 'Output path_output already exists!'
|
||||
assert os.path.exists(os.path.dirname(path_output)), 'Output folder not exists!'
|
||||
|
||||
|
||||
import torch
|
||||
from share import *
|
||||
from cldm.model import load_state_dict, create_model
|
||||
|
||||
from cldm.model import load_state_dict
|
||||
|
||||
sd15_state_dict = load_state_dict(path_sd15)
|
||||
sd15_with_control_state_dict = load_state_dict(path_sd15_with_control)
|
||||
input_state_dict = load_state_dict(path_input)
|
||||
|
||||
a = 0
|
||||
model = create_model('./models/cldm_v15.yaml').cpu()
|
||||
output_state_dict = model.state_dict()
|
||||
|
||||
# balabala
|
||||
|
||||
torch.save(output_state_dict, path_output)
|
||||
print('Transferred model saved at ' + path_output)
|
||||
|
||||
Reference in New Issue
Block a user