Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,8 +38,9 @@ def encode(init_image, torch_device, ae):
|
|
| 38 |
init_image = torch.from_numpy(init_image).permute(2, 0, 1).float() / 127.5 - 1
|
| 39 |
init_image = init_image.unsqueeze(0)
|
| 40 |
init_image = init_image.to(torch_device)
|
| 41 |
-
print("!!!!!!!init_image
|
| 42 |
-
print("!!!!!!!ae
|
|
|
|
| 43 |
with torch.no_grad():
|
| 44 |
init_image = ae.encode(init_image.to()).to(torch.bfloat16)
|
| 45 |
return init_image
|
|
@@ -70,6 +71,10 @@ class FluxEditor:
|
|
| 70 |
self.clip.eval()
|
| 71 |
self.ae.eval()
|
| 72 |
self.model.eval()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
@torch.inference_mode()
|
| 75 |
@spaces.GPU(duration=180)
|
|
|
|
| 38 |
init_image = torch.from_numpy(init_image).permute(2, 0, 1).float() / 127.5 - 1
|
| 39 |
init_image = init_image.unsqueeze(0)
|
| 40 |
init_image = init_image.to(torch_device)
|
| 41 |
+
print("!!!!!!!init_image!!!!!!",init_image.device)
|
| 42 |
+
print("!!!!!!!ae!!!!!!",next(ae.parameters()).device)
|
| 43 |
+
|
| 44 |
with torch.no_grad():
|
| 45 |
init_image = ae.encode(init_image.to()).to(torch.bfloat16)
|
| 46 |
return init_image
|
|
|
|
| 71 |
self.clip.eval()
|
| 72 |
self.ae.eval()
|
| 73 |
self.model.eval()
|
| 74 |
+
self.t5.cuda()
|
| 75 |
+
self.clip.cuda()
|
| 76 |
+
self.ae.cuda()
|
| 77 |
+
self.model.cuda()
|
| 78 |
|
| 79 |
@torch.inference_mode()
|
| 80 |
@spaces.GPU(duration=180)
|