MohamedRashad commited on
Commit
8c0e5a7
Β·
1 Parent(s): 8f812c4

Refactor CUDA device usage in app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -118,7 +118,7 @@ def process(input_fg, prompt, input_undo_steps, image_width, image_height, seed,
118
 
119
  fg = resize_and_center_crop(input_fg, image_width, image_height)
120
  concat_conds = numpy2pytorch([fg]).to(device="cuda", dtype=vae.dtype)
121
- concat_conds = vae.encode(concat_conds).latent_dist.mode() * vae.config.scaling_factor
122
 
123
  conds = encode_cropped_prompt_77tokens(prompt)
124
  unconds = encode_cropped_prompt_77tokens(n_prompt)
 
118
 
119
  fg = resize_and_center_crop(input_fg, image_width, image_height)
120
  concat_conds = numpy2pytorch([fg]).to(device="cuda", dtype=vae.dtype)
121
+ concat_conds = vae.encode(torch.tensor(concat_conds)).latent_dist.mode() * vae.config.scaling_factor
122
 
123
  conds = encode_cropped_prompt_77tokens(prompt)
124
  unconds = encode_cropped_prompt_77tokens(n_prompt)