Spaces:
Running
Running
fix: update model list
Browse files
app.py
CHANGED
@@ -3,21 +3,32 @@ import requests
|
|
3 |
|
4 |
prefix = "https://smartfeed-custom-tools.hf.space/gradio_api/file="
|
5 |
|
6 |
-
|
7 |
"o3",
|
|
|
8 |
"gpt-5",
|
9 |
-
"o4-mini",
|
10 |
-
"o4-mini-high",
|
11 |
]
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
def change_image_style(
|
15 |
image_url,
|
16 |
style_image_url,
|
17 |
-
|
18 |
extract_prompt,
|
19 |
prompt_prefix
|
20 |
):
|
|
|
|
|
21 |
data = {
|
22 |
"image_url": image_url,
|
23 |
"style_image_url": style_image_url,
|
@@ -90,7 +101,7 @@ with gr.Blocks() as demo:
|
|
90 |
with gr.Column(visible=False) as clear_button:
|
91 |
remove_and_reupload = gr.ClearButton(value="Remove and upload new ones", components=files, size="sm")
|
92 |
input_image = gr.Image(label="Input Image", type="filepath", interactive=True)
|
93 |
-
extract_model = gr.Dropdown(choices=
|
94 |
extract_prompt = gr.Textbox(lines=2, label="Extracted Prompt", value="Accurately extract everything from this photo into a prompt especially the hairstyle excluding the backgrounds. I want to replicate it perfectly. need to be a complete paragraph")
|
95 |
prompt_prefix = gr.Textbox(lines=1, label="Prompt Prefix", value="change the backgrounds to match this:")
|
96 |
|
|
|
3 |
|
4 |
prefix = "https://smartfeed-custom-tools.hf.space/gradio_api/file="
|
5 |
|
6 |
+
extract_model_tag_list = [
|
7 |
"o3",
|
8 |
+
"o3(poe)",
|
9 |
"gpt-5",
|
10 |
+
"o4-mini(openrouter)",
|
11 |
+
"o4-mini-high(openrouter)",
|
12 |
]
|
13 |
|
14 |
+
extract_model_map = {
|
15 |
+
"o3": "o3-2025-04-16",
|
16 |
+
"o3(poe)": "o3(poe)",
|
17 |
+
"gpt-5": "gpt-5-2025-08-07",
|
18 |
+
"o4-mini(openrouter)": "openai/o4-mini",
|
19 |
+
"o4-mini-high(openrouter)": "openai/o4-mini-high",
|
20 |
+
}
|
21 |
+
|
22 |
|
23 |
def change_image_style(
|
24 |
image_url,
|
25 |
style_image_url,
|
26 |
+
extract_model_tag,
|
27 |
extract_prompt,
|
28 |
prompt_prefix
|
29 |
):
|
30 |
+
extract_model = extract_model_map.get(extract_model_tag, "o3")
|
31 |
+
|
32 |
data = {
|
33 |
"image_url": image_url,
|
34 |
"style_image_url": style_image_url,
|
|
|
101 |
with gr.Column(visible=False) as clear_button:
|
102 |
remove_and_reupload = gr.ClearButton(value="Remove and upload new ones", components=files, size="sm")
|
103 |
input_image = gr.Image(label="Input Image", type="filepath", interactive=True)
|
104 |
+
extract_model = gr.Dropdown(choices=extract_model_tag_list, label="Extract Model", value="o3")
|
105 |
extract_prompt = gr.Textbox(lines=2, label="Extracted Prompt", value="Accurately extract everything from this photo into a prompt especially the hairstyle excluding the backgrounds. I want to replicate it perfectly. need to be a complete paragraph")
|
106 |
prompt_prefix = gr.Textbox(lines=1, label="Prompt Prefix", value="change the backgrounds to match this:")
|
107 |
|