Update gradio_app.py
Browse files- gradio_app.py +4 -0
gradio_app.py
CHANGED
@@ -114,6 +114,8 @@ save_fps = 8
|
|
114 |
print("resolution:", resolution)
|
115 |
print("init done.")
|
116 |
|
|
|
|
|
117 |
def transpose_if_needed(tensor):
|
118 |
h = tensor.shape[-2]
|
119 |
w = tensor.shape[-1]
|
@@ -160,6 +162,8 @@ def get_image(image1, prompt, image2, dim_steps=50, ddim_eta=1., fs=None, seed=1
|
|
160 |
# _, filename = os.path.split(file_list[idx*2])
|
161 |
|
162 |
global model
|
|
|
|
|
163 |
ddim_sampler = DDIMSampler(model) if not multiple_cond_cfg else DDIMSampler_multicond(model)
|
164 |
batch_size = 1
|
165 |
fs = torch.tensor([fs], dtype=torch.long, device=model.device)
|
|
|
114 |
print("resolution:", resolution)
|
115 |
print("init done.")
|
116 |
|
117 |
+
|
118 |
+
|
119 |
def transpose_if_needed(tensor):
|
120 |
h = tensor.shape[-2]
|
121 |
w = tensor.shape[-1]
|
|
|
162 |
# _, filename = os.path.split(file_list[idx*2])
|
163 |
|
164 |
global model
|
165 |
+
model.cuda()
|
166 |
+
|
167 |
ddim_sampler = DDIMSampler(model) if not multiple_cond_cfg else DDIMSampler_multicond(model)
|
168 |
batch_size = 1
|
169 |
fs = torch.tensor([fs], dtype=torch.long, device=model.device)
|