Spaces:
Running
Running
Sebastiankay
commited on
Commit
·
152e3dd
1
Parent(s):
a1f0ffd
Oct 24, 2024, 11:32 AM
Browse files
app.py
CHANGED
@@ -26,7 +26,6 @@ API_OLD = urllib.parse.unquote(os.getenv("API_OLD"))
|
|
26 |
# print(API_V1_MODELS)
|
27 |
# print(API_V1_IMAGE)
|
28 |
|
29 |
-
|
30 |
CACHE_DIR = os.path.join(os.path.dirname(__file__), "cache")
|
31 |
IMAGE_DIR = os.path.join(CACHE_DIR, "images")
|
32 |
if not os.path.exists(CACHE_DIR):
|
@@ -60,6 +59,7 @@ theme = gr.themes.Soft(
|
|
60 |
|
61 |
title = "Bilder Builder"
|
62 |
|
|
|
63 |
# MARK: GET PREV. IMAGES
|
64 |
def get_gallery_images(dirpath):
|
65 |
gallery_images = [dirpath + "/" + s for s in os.listdir(dirpath) if os.path.isfile(os.path.join(dirpath, s))]
|
@@ -150,6 +150,7 @@ def image_get_dominant_color(image_path):
|
|
150 |
def clear_components():
|
151 |
return None
|
152 |
|
|
|
153 |
def process(Prompt, used_model, image_width, image_height, image_ratio, image_seed, randomize_seed):
|
154 |
if Prompt == "":
|
155 |
gr.Info("Kein Prompt angegeben, es wird ein zufälliger Prompt generiert.", duration=12)
|
@@ -215,7 +216,7 @@ with gr.Blocks(theme=theme, head=custom_head, css=custom_css, js=custom_js, titl
|
|
215 |
with gr.Row(elem_classes="image_size_selctor_wrapper"):
|
216 |
with gr.Column(scale=1):
|
217 |
with gr.Row():
|
218 |
-
select_model = gr.Dropdown(choices=["FLUX", "FLUX
|
219 |
# with gr.Row():
|
220 |
image_width = gr.Number(label="Breite", minimum=256, maximum=MAX_IMAGE_SIZE, value=1152, step=128, elem_id="image_width_selector", elem_classes="image-width-selector", scale=1, visible=False)
|
221 |
image_height = gr.Number(label="Höhe", minimum=256, maximum=MAX_IMAGE_SIZE, value=2048, step=128, elem_id="image_height_selector", elem_classes="image-height-selector", scale=1, visible=False)
|
|
|
26 |
# print(API_V1_MODELS)
|
27 |
# print(API_V1_IMAGE)
|
28 |
|
|
|
29 |
CACHE_DIR = os.path.join(os.path.dirname(__file__), "cache")
|
30 |
IMAGE_DIR = os.path.join(CACHE_DIR, "images")
|
31 |
if not os.path.exists(CACHE_DIR):
|
|
|
59 |
|
60 |
title = "Bilder Builder"
|
61 |
|
62 |
+
|
63 |
# MARK: GET PREV. IMAGES
|
64 |
def get_gallery_images(dirpath):
|
65 |
gallery_images = [dirpath + "/" + s for s in os.listdir(dirpath) if os.path.isfile(os.path.join(dirpath, s))]
|
|
|
150 |
def clear_components():
|
151 |
return None
|
152 |
|
153 |
+
|
154 |
def process(Prompt, used_model, image_width, image_height, image_ratio, image_seed, randomize_seed):
|
155 |
if Prompt == "":
|
156 |
gr.Info("Kein Prompt angegeben, es wird ein zufälliger Prompt generiert.", duration=12)
|
|
|
216 |
with gr.Row(elem_classes="image_size_selctor_wrapper"):
|
217 |
with gr.Column(scale=1):
|
218 |
with gr.Row():
|
219 |
+
select_model = gr.Dropdown(choices=["FLUX-API-OLD", "FLUX", "FLUX-Realism", "FLUX-Pixel", "FLUX-Anime", "FLUX-3D", "FLUX-Disney", "ANY-DARK", "Stable-Diffusion-XL-Base", "Stable-Diffusion-XL-Lightning"], value="FLUX", label="Model", elem_id="select_model", elem_classes="select-model")
|
220 |
# with gr.Row():
|
221 |
image_width = gr.Number(label="Breite", minimum=256, maximum=MAX_IMAGE_SIZE, value=1152, step=128, elem_id="image_width_selector", elem_classes="image-width-selector", scale=1, visible=False)
|
222 |
image_height = gr.Number(label="Höhe", minimum=256, maximum=MAX_IMAGE_SIZE, value=2048, step=128, elem_id="image_height_selector", elem_classes="image-height-selector", scale=1, visible=False)
|