Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,9 @@ import gradio as gr
|
|
| 4 |
import os
|
| 5 |
|
| 6 |
def convert_embedding(uploaded_files):
|
|
|
|
|
|
|
|
|
|
| 7 |
output_files = []
|
| 8 |
|
| 9 |
for uploaded_file in uploaded_files:
|
|
@@ -36,7 +39,7 @@ def convert_embedding(uploaded_files):
|
|
| 36 |
|
| 37 |
custom_css = """
|
| 38 |
body {
|
| 39 |
-
background-color: #
|
| 40 |
color: #ffffff;
|
| 41 |
font-family: Arial, sans-serif;
|
| 42 |
}
|
|
@@ -45,15 +48,16 @@ custom_css = """
|
|
| 45 |
margin: auto;
|
| 46 |
padding: 20px;
|
| 47 |
border-radius: 10px;
|
| 48 |
-
background: #
|
| 49 |
-
box-shadow: 0 0 10px rgba(
|
| 50 |
}
|
| 51 |
.gradio-container h1 {
|
| 52 |
text-align: center;
|
| 53 |
font-size: 24px;
|
|
|
|
| 54 |
}
|
| 55 |
.gradio-container button {
|
| 56 |
-
background-color: #
|
| 57 |
color: white;
|
| 58 |
padding: 10px 15px;
|
| 59 |
border: none;
|
|
@@ -62,19 +66,19 @@ custom_css = """
|
|
| 62 |
font-size: 16px;
|
| 63 |
}
|
| 64 |
.gradio-container button:hover {
|
| 65 |
-
background-color: #
|
| 66 |
}
|
| 67 |
"""
|
| 68 |
|
| 69 |
iface = gr.Interface(
|
| 70 |
fn=convert_embedding,
|
| 71 |
-
inputs=gr.Files(label="Upload SD-1.5 embeddings"),
|
| 72 |
outputs=gr.Files(label="Download converted SDXL safetensors embeddings"),
|
| 73 |
title="✨ SD-1.5 to SDXL Embedding Converter | Now supports multiple files ⚡",
|
| 74 |
-
description="Upload
|
| 75 |
theme="default",
|
| 76 |
-
css=custom_css
|
|
|
|
| 77 |
)
|
| 78 |
|
| 79 |
-
|
| 80 |
-
iface.launch()
|
|
|
|
| 4 |
import os
|
| 5 |
|
| 6 |
def convert_embedding(uploaded_files):
|
| 7 |
+
if len(uploaded_files) > 5:
|
| 8 |
+
raise ValueError("You can upload a maximum of 5 files at a time.")
|
| 9 |
+
|
| 10 |
output_files = []
|
| 11 |
|
| 12 |
for uploaded_file in uploaded_files:
|
|
|
|
| 39 |
|
| 40 |
custom_css = """
|
| 41 |
body {
|
| 42 |
+
background-color: #121212;
|
| 43 |
color: #ffffff;
|
| 44 |
font-family: Arial, sans-serif;
|
| 45 |
}
|
|
|
|
| 48 |
margin: auto;
|
| 49 |
padding: 20px;
|
| 50 |
border-radius: 10px;
|
| 51 |
+
background: #1e1e1e;
|
| 52 |
+
box-shadow: 0 0 10px rgba(255, 102, 0, 0.5);
|
| 53 |
}
|
| 54 |
.gradio-container h1 {
|
| 55 |
text-align: center;
|
| 56 |
font-size: 24px;
|
| 57 |
+
color: #ff6600;
|
| 58 |
}
|
| 59 |
.gradio-container button {
|
| 60 |
+
background-color: #ff6600;
|
| 61 |
color: white;
|
| 62 |
padding: 10px 15px;
|
| 63 |
border: none;
|
|
|
|
| 66 |
font-size: 16px;
|
| 67 |
}
|
| 68 |
.gradio-container button:hover {
|
| 69 |
+
background-color: #cc5500;
|
| 70 |
}
|
| 71 |
"""
|
| 72 |
|
| 73 |
iface = gr.Interface(
|
| 74 |
fn=convert_embedding,
|
| 75 |
+
inputs=gr.Files(label="Upload SD-1.5 embeddings (Max 5)", type="file"),
|
| 76 |
outputs=gr.Files(label="Download converted SDXL safetensors embeddings"),
|
| 77 |
title="✨ SD-1.5 to SDXL Embedding Converter | Now supports multiple files ⚡",
|
| 78 |
+
description="Upload up to 5 SD-1.5 embedding files to convert them to SDXL. Stylish and efficient!",
|
| 79 |
theme="default",
|
| 80 |
+
css=custom_css,
|
| 81 |
+
live=True
|
| 82 |
)
|
| 83 |
|
| 84 |
+
iface.launch()
|
|
|