Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -14,6 +14,9 @@ SAVE_DIR = "saved_images" # Gradio will handle the persistence
|
|
14 |
if not os.path.exists(SAVE_DIR):
|
15 |
os.makedirs(SAVE_DIR, exist_ok=True)
|
16 |
|
|
|
|
|
|
|
17 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
18 |
repo_id = "black-forest-labs/FLUX.1-dev"
|
19 |
adapter_id = "prithivMLmods/EBook-Creative-Cover-Flux-LoRA"
|
@@ -129,7 +132,12 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css, analytics_enabled=False) as demo
|
|
129 |
)
|
130 |
run_button = gr.Button("Run", scale=0)
|
131 |
|
132 |
-
|
|
|
|
|
|
|
|
|
|
|
133 |
|
134 |
with gr.Accordion("Advanced Settings", open=False):
|
135 |
seed = gr.Slider(
|
@@ -198,7 +206,6 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css, analytics_enabled=False) as demo
|
|
198 |
)
|
199 |
refresh_btn = gr.Button("π Refresh Gallery")
|
200 |
|
201 |
-
|
202 |
# Event handlers
|
203 |
def refresh_gallery():
|
204 |
return load_generated_images()
|
|
|
14 |
if not os.path.exists(SAVE_DIR):
|
15 |
os.makedirs(SAVE_DIR, exist_ok=True)
|
16 |
|
17 |
+
# Load the default image
|
18 |
+
DEFAULT_IMAGE_PATH = "cover1.webp"
|
19 |
+
|
20 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
21 |
repo_id = "black-forest-labs/FLUX.1-dev"
|
22 |
adapter_id = "prithivMLmods/EBook-Creative-Cover-Flux-LoRA"
|
|
|
132 |
)
|
133 |
run_button = gr.Button("Run", scale=0)
|
134 |
|
135 |
+
# Modified to include the default image
|
136 |
+
result = gr.Image(
|
137 |
+
label="Result",
|
138 |
+
show_label=False,
|
139 |
+
value=DEFAULT_IMAGE_PATH # Set the default image
|
140 |
+
)
|
141 |
|
142 |
with gr.Accordion("Advanced Settings", open=False):
|
143 |
seed = gr.Slider(
|
|
|
206 |
)
|
207 |
refresh_btn = gr.Button("π Refresh Gallery")
|
208 |
|
|
|
209 |
# Event handlers
|
210 |
def refresh_gallery():
|
211 |
return load_generated_images()
|