Spaces:
Running
on
Zero
Running
on
Zero
Himanshu-AT
commited on
Commit
·
fd9cbdf
1
Parent(s):
36f2a12
working xformers
Browse files
app.py
CHANGED
@@ -16,7 +16,6 @@ MAX_IMAGE_SIZE = 2048
|
|
16 |
pipe = FluxFillPipeline.from_pretrained("black-forest-labs/FLUX.1-Fill-dev", torch_dtype=torch.bfloat16).to("cuda")
|
17 |
pipe.load_lora_weights("alvdansen/flux-koda")
|
18 |
pipe.enable_sequential_cpu_offload()
|
19 |
-
pipe.enable_xformers_memory_efficient_attention()
|
20 |
pipe.enable_fp16()
|
21 |
|
22 |
def calculate_optimal_dimensions(image: Image.Image):
|
@@ -58,6 +57,8 @@ def calculate_optimal_dimensions(image: Image.Image):
|
|
58 |
|
59 |
@spaces.GPU(durations=300)
|
60 |
def infer(edit_images, prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidance_scale=3.5, num_inference_steps=28, progress=gr.Progress(track_tqdm=True)):
|
|
|
|
|
61 |
image = edit_images["background"]
|
62 |
width, height = calculate_optimal_dimensions(image)
|
63 |
mask = edit_images["layers"][0]
|
|
|
16 |
pipe = FluxFillPipeline.from_pretrained("black-forest-labs/FLUX.1-Fill-dev", torch_dtype=torch.bfloat16).to("cuda")
|
17 |
pipe.load_lora_weights("alvdansen/flux-koda")
|
18 |
pipe.enable_sequential_cpu_offload()
|
|
|
19 |
pipe.enable_fp16()
|
20 |
|
21 |
def calculate_optimal_dimensions(image: Image.Image):
|
|
|
57 |
|
58 |
@spaces.GPU(durations=300)
|
59 |
def infer(edit_images, prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidance_scale=3.5, num_inference_steps=28, progress=gr.Progress(track_tqdm=True)):
|
60 |
+
pipe.enable_xformers_memory_efficient_attention()
|
61 |
+
|
62 |
image = edit_images["background"]
|
63 |
width, height = calculate_optimal_dimensions(image)
|
64 |
mask = edit_images["layers"][0]
|