Spaces:
Running
on
Zero
Running
on
Zero
update app.py
Browse files
app.py
CHANGED
@@ -134,7 +134,8 @@ def process(prompt, a_prompt, n_prompt, num_samples, image_resolution, ddim_step
|
|
134 |
|
135 |
# set up cfg
|
136 |
uc_local_control = local_control
|
137 |
-
uc_global_control =
|
|
|
138 |
cond = {
|
139 |
"local_control": [local_control],
|
140 |
"c_crossattn": [model.get_learned_conditioning([prompt + ', ' + a_prompt] * num_samples)],
|
@@ -192,7 +193,7 @@ define model
|
|
192 |
config_file = "configs/anycontrol.yaml"
|
193 |
model_file = "ckpts/anycontrol_15.ckpt"
|
194 |
model = create_model(config_file).cpu()
|
195 |
-
model.load_state_dict(load_state_dict(model_file, location='
|
196 |
model = model.cuda()
|
197 |
ddim_sampler = DDIMSampler(model)
|
198 |
|
|
|
134 |
|
135 |
# set up cfg
|
136 |
uc_local_control = local_control
|
137 |
+
uc_global_control = {k:torch.zeros_like(v) for k,v in global_control.items()}
|
138 |
+
|
139 |
cond = {
|
140 |
"local_control": [local_control],
|
141 |
"c_crossattn": [model.get_learned_conditioning([prompt + ', ' + a_prompt] * num_samples)],
|
|
|
193 |
config_file = "configs/anycontrol.yaml"
|
194 |
model_file = "ckpts/anycontrol_15.ckpt"
|
195 |
model = create_model(config_file).cpu()
|
196 |
+
model.load_state_dict(load_state_dict(model_file, location='cpu'))
|
197 |
model = model.cuda()
|
198 |
ddim_sampler = DDIMSampler(model)
|
199 |
|