Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -35,12 +35,12 @@ import torch
|
|
35 |
# print(f"Allocated memory: {allocated_memory / 1024**2:.2f} MB")
|
36 |
# print(f"Reserved memory: {reserved_memory / 1024**2:.2f} MB")
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
print("!!!!!!!!!!!!device!!!!!!!!!!!!!!",device)
|
45 |
print("!!!!!!!!self.t5!!!!!!",next(t5.parameters()).device)
|
46 |
print("!!!!!!!!self.clip!!!!!!",next(clip.parameters()).device)
|
@@ -59,12 +59,12 @@ class SamplingOptions:
|
|
59 |
|
60 |
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
|
69 |
|
70 |
|
|
|
35 |
# print(f"Allocated memory: {allocated_memory / 1024**2:.2f} MB")
|
36 |
# print(f"Reserved memory: {reserved_memory / 1024**2:.2f} MB")
|
37 |
|
38 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
39 |
+
name = 'flux-dev'
|
40 |
+
ae = load_ae(name, device)
|
41 |
+
t5 = load_t5(device, max_length=256 if name == "flux-schnell" else 512)
|
42 |
+
clip = load_clip(device)
|
43 |
+
model = load_flow_model(name, device=device)
|
44 |
print("!!!!!!!!!!!!device!!!!!!!!!!!!!!",device)
|
45 |
print("!!!!!!!!self.t5!!!!!!",next(t5.parameters()).device)
|
46 |
print("!!!!!!!!self.clip!!!!!!",next(clip.parameters()).device)
|
|
|
59 |
|
60 |
|
61 |
|
62 |
+
offload = False
|
63 |
+
name = "flux-dev"
|
64 |
+
is_schnell = False
|
65 |
+
feature_path = 'feature'
|
66 |
+
output_dir = 'result'
|
67 |
+
add_sampling_metadata = True
|
68 |
|
69 |
|
70 |
|