nowsyn commited on
Commit
3037830
1 Parent(s): 72f8ea7

update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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 = get_unconditional_global(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='cuda'))
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