Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from pruna import PrunaModel, smash, SmashConfig
|
|
10 |
dtype = torch.bfloat16
|
11 |
device = "cuda" if torch.cuda.is_available() else "CPU"
|
12 |
|
13 |
-
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", dtype=dtype).to(
|
14 |
smash_config = SmashConfig()
|
15 |
smash_config["factorizer"] = "qkv_diffusers"
|
16 |
smash_config["cacher"] = "fora"
|
@@ -22,6 +22,8 @@ pipe = smash(
|
|
22 |
model=pipe,
|
23 |
smash_config=smash_config,
|
24 |
)
|
|
|
|
|
25 |
|
26 |
MAX_SEED = np.iinfo(np.int32).max
|
27 |
MAX_IMAGE_SIZE = 2048
|
|
|
10 |
dtype = torch.bfloat16
|
11 |
device = "cuda" if torch.cuda.is_available() else "CPU"
|
12 |
|
13 |
+
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", dtype=dtype).to("cpu")
|
14 |
smash_config = SmashConfig()
|
15 |
smash_config["factorizer"] = "qkv_diffusers"
|
16 |
smash_config["cacher"] = "fora"
|
|
|
22 |
model=pipe,
|
23 |
smash_config=smash_config,
|
24 |
)
|
25 |
+
pipe.move_to_device(device)
|
26 |
+
|
27 |
|
28 |
MAX_SEED = np.iinfo(np.int32).max
|
29 |
MAX_IMAGE_SIZE = 2048
|