Spaces:
Sleeping
Sleeping
Himanshu-AT
commited on
Commit
·
b07c027
1
Parent(s):
afb6519
refactor
Browse files
app.py
CHANGED
@@ -85,18 +85,16 @@ def infer(edit_images, prompt, lora_model, strength, seed=42, randomize_seed=Fal
|
|
85 |
pipe.load_lora_weights(lora_models[lora_model])
|
86 |
pipe.enable_lora()
|
87 |
|
88 |
-
image_path = edit_images["background"]
|
89 |
-
mask_path = edit_images["layers"][0]
|
90 |
-
|
91 |
gr.Info("starting checks")
|
92 |
|
93 |
-
image
|
94 |
-
mask
|
95 |
|
96 |
if not image:
|
97 |
gr.Info("Please upload an image.")
|
98 |
return None, None
|
99 |
|
|
|
100 |
width, height = calculate_optimal_dimensions(image)
|
101 |
if randomize_seed:
|
102 |
seed = random.randint(0, MAX_SEED)
|
|
|
85 |
pipe.load_lora_weights(lora_models[lora_model])
|
86 |
pipe.enable_lora()
|
87 |
|
|
|
|
|
|
|
88 |
gr.Info("starting checks")
|
89 |
|
90 |
+
image = edit_images["background"]
|
91 |
+
mask = edit_images["layers"][0]
|
92 |
|
93 |
if not image:
|
94 |
gr.Info("Please upload an image.")
|
95 |
return None, None
|
96 |
|
97 |
+
|
98 |
width, height = calculate_optimal_dimensions(image)
|
99 |
if randomize_seed:
|
100 |
seed = random.randint(0, MAX_SEED)
|