Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -53,7 +53,7 @@ def generate_image(prompt, progress=gr.Progress()):
|
|
53 |
progress(0, desc="Improving prompt...")
|
54 |
improved_prompt = improve_prompt(prompt)
|
55 |
|
56 |
-
progress(0.2, desc="Sending request
|
57 |
try:
|
58 |
image = client.text_to_image(improved_prompt, model="black-forest-labs/FLUX.1-schnell")
|
59 |
|
@@ -80,79 +80,7 @@ def pil_to_base64(img):
|
|
80 |
|
81 |
|
82 |
css = """
|
83 |
-
|
84 |
-
background-color: #f4f4f4;
|
85 |
-
font-family: 'Arial', sans-serif;
|
86 |
-
}
|
87 |
-
|
88 |
-
.container {
|
89 |
-
max-width: 900px;
|
90 |
-
margin: auto;
|
91 |
-
padding: 30px;
|
92 |
-
border-radius: 10px;
|
93 |
-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
|
94 |
-
background-color: white;
|
95 |
-
}
|
96 |
-
|
97 |
-
.title {
|
98 |
-
text-align: center;
|
99 |
-
font-size: 3em;
|
100 |
-
margin-bottom: 0.5em;
|
101 |
-
color: #3a3a3a;
|
102 |
-
}
|
103 |
-
|
104 |
-
.input-section {
|
105 |
-
background-color: #e3f7fc;
|
106 |
-
border-radius: 8px;
|
107 |
-
padding: 15px;
|
108 |
-
}
|
109 |
-
|
110 |
-
.output-section {
|
111 |
-
background-color: #f0f0f0;
|
112 |
-
border-radius: 8px;
|
113 |
-
padding: 15px;
|
114 |
-
}
|
115 |
-
|
116 |
-
.output-section img {
|
117 |
-
max-width: 100%;
|
118 |
-
height: auto;
|
119 |
-
border-radius: 8px;
|
120 |
-
}
|
121 |
-
|
122 |
-
.submit-button {
|
123 |
-
background-color: #007BFF;
|
124 |
-
border: none;
|
125 |
-
border-radius: 5px;
|
126 |
-
color: white;
|
127 |
-
padding: 12px 20px;
|
128 |
-
cursor: pointer;
|
129 |
-
transition: background-color 0.3s ease, transform 0.2s ease;
|
130 |
-
}
|
131 |
-
|
132 |
-
.submit-button:hover {
|
133 |
-
background-color: #0056b3;
|
134 |
-
transform: scale(1.05);
|
135 |
-
}
|
136 |
-
|
137 |
-
.error-message {
|
138 |
-
color: red;
|
139 |
-
text-align: center;
|
140 |
-
font-weight: bold;
|
141 |
-
}
|
142 |
-
|
143 |
-
.label {
|
144 |
-
font-weight: bold;
|
145 |
-
}
|
146 |
-
|
147 |
-
.download-link {
|
148 |
-
color: #007BFF;
|
149 |
-
font-weight: bold;
|
150 |
-
text-decoration: none;
|
151 |
-
}
|
152 |
-
|
153 |
-
.download-link:hover {
|
154 |
-
text-decoration: underline;
|
155 |
-
}
|
156 |
"""
|
157 |
|
158 |
with gr.Blocks(css=css) as demo:
|
|
|
53 |
progress(0, desc="Improving prompt...")
|
54 |
improved_prompt = improve_prompt(prompt)
|
55 |
|
56 |
+
progress(0.2, desc="Sending request ")
|
57 |
try:
|
58 |
image = client.text_to_image(improved_prompt, model="black-forest-labs/FLUX.1-schnell")
|
59 |
|
|
|
80 |
|
81 |
|
82 |
css = """
|
83 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
"""
|
85 |
|
86 |
with gr.Blocks(css=css) as demo:
|