wjs0725 commited on
Commit
49d340b
1 Parent(s): c633291

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
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
- global device = "cuda" if torch.cuda.is_available() else "cpu"
39
- global name = 'flux-dev'
40
- global ae = load_ae(name, device)
41
- global t5 = load_t5(device, max_length=256 if name == "flux-schnell" else 512)
42
- global clip = load_clip(device)
43
- global 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,12 +59,12 @@ class SamplingOptions:
59
 
60
 
61
 
62
- global offload = False
63
- global name = "flux-dev"
64
- global is_schnell = False
65
- global feature_path = 'feature'
66
- global output_dir = 'result'
67
- global add_sampling_metadata = True
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