Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ def get_models(name: str, device: torch.device, offload: bool):
|
|
26 |
class FluxGenerator:
|
27 |
def __init__(self):
|
28 |
self.device = torch.device('cuda')
|
29 |
-
self.offload =
|
30 |
self.model_name = 'flux-dev'
|
31 |
self.model, self.ae, self.t5, self.clip = get_models(
|
32 |
self.model_name,
|
@@ -41,6 +41,7 @@ flux_generator = FluxGenerator()
|
|
41 |
|
42 |
|
43 |
@spaces.GPU
|
|
|
44 |
def generate_image(
|
45 |
width,
|
46 |
height,
|
|
|
26 |
class FluxGenerator:
|
27 |
def __init__(self):
|
28 |
self.device = torch.device('cuda')
|
29 |
+
self.offload = True
|
30 |
self.model_name = 'flux-dev'
|
31 |
self.model, self.ae, self.t5, self.clip = get_models(
|
32 |
self.model_name,
|
|
|
41 |
|
42 |
|
43 |
@spaces.GPU
|
44 |
+
@torch.inference_mode()
|
45 |
def generate_image(
|
46 |
width,
|
47 |
height,
|