Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -17,6 +17,7 @@ from diffusers import EulerDiscreteScheduler
|
|
17 |
from PIL import Image, ImageDraw, ImageFont
|
18 |
import os
|
19 |
|
|
|
20 |
device = "cuda"
|
21 |
ckpt_dir = snapshot_download(repo_id="Kwai-Kolors/Kolors")
|
22 |
ckpt_dir_canny = snapshot_download(repo_id="Kwai-Kolors/Kolors-ControlNet-Canny")
|
@@ -258,26 +259,40 @@ footer {
|
|
258 |
"""
|
259 |
|
260 |
with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as Kolors:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
text_position = gr.State("middle-center")
|
262 |
with gr.Row():
|
263 |
with gr.Column(elem_id="col-left"):
|
264 |
with gr.Row():
|
265 |
prompt = gr.Textbox(
|
266 |
-
label="Prompt",
|
267 |
placeholder="Enter your prompt",
|
268 |
lines=2,
|
269 |
value="coffee in a cup bokeh --ar 85:128 --v 6.0 --style raw5, 4K, 리얼리티 사진"
|
270 |
)
|
271 |
with gr.Row():
|
272 |
text_for_image = gr.Textbox(
|
273 |
-
label="Text for Image Generation",
|
274 |
placeholder="Enter text to be converted into an image",
|
275 |
lines=3,
|
276 |
value="대한 萬世 GO"
|
277 |
)
|
278 |
with gr.Row():
|
279 |
with gr.Column():
|
280 |
-
gr.Markdown("Text Position")
|
281 |
with gr.Row(elem_classes="text-position-grid"):
|
282 |
position_buttons = [gr.Button("•") for _ in range(25)]
|
283 |
|
@@ -286,14 +301,14 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as Kolors:
|
|
286 |
btn.click(update_button_states, inputs=[text_position], outputs=position_buttons)
|
287 |
with gr.Column():
|
288 |
font_size = gr.Slider(
|
289 |
-
label="Text Size",
|
290 |
minimum=12,
|
291 |
maximum=144,
|
292 |
step=1,
|
293 |
value=72
|
294 |
)
|
295 |
with gr.Row():
|
296 |
-
font_dropdown = gr.Dropdown(choices=get_font_files(), label="Select Font", value="Arial_Unicode.ttf")
|
297 |
|
298 |
with gr.Row():
|
299 |
preview_text = gr.Textbox(label="Preview Text", value="Hello, World!")
|
@@ -301,7 +316,7 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as Kolors:
|
|
301 |
|
302 |
font_preview = gr.Image(label="Font Preview")
|
303 |
|
304 |
-
with gr.Accordion("Advanced Settings", open=False):
|
305 |
negative_prompt = gr.Textbox(
|
306 |
label="Negative prompt",
|
307 |
placeholder="Enter a negative prompt",
|
|
|
17 |
from PIL import Image, ImageDraw, ImageFont
|
18 |
import os
|
19 |
|
20 |
+
|
21 |
device = "cuda"
|
22 |
ckpt_dir = snapshot_download(repo_id="Kwai-Kolors/Kolors")
|
23 |
ckpt_dir_canny = snapshot_download(repo_id="Kwai-Kolors/Kolors-ControlNet-Canny")
|
|
|
259 |
"""
|
260 |
|
261 |
with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as Kolors:
|
262 |
+
gr.Markdown("""
|
263 |
+
"EveryText": Technology unveiled that reflects/represents all languages (characters) worldwide in AI-generated images, without the need for prior training.
|
264 |
+
This interface generates images based on the text you input. Please fill in each field below:
|
265 |
+
- **1. Prompt**: Enter a basic description for image generation.
|
266 |
+
- **2. Text for Image Generation**: Enter the text to be displayed on the image.
|
267 |
+
- **3. Text Position**: Choose the position of the text within the image.
|
268 |
+
- **4. Text Size**: Adjust the size of the text.
|
269 |
+
- **5. Select Font(Option)**: Choose the font you desire.
|
270 |
+
- **6. Advanced Settings(Option)**: Refine the image generation process through advanced settings.
|
271 |
+
|
272 |
+
**Huggingface Service Link: https://fantaxy-EveryText.hf.space / Discord Community: https://discord.gg/openfreeai / [email protected]
|
273 |
+
""")
|
274 |
+
|
275 |
+
|
276 |
text_position = gr.State("middle-center")
|
277 |
with gr.Row():
|
278 |
with gr.Column(elem_id="col-left"):
|
279 |
with gr.Row():
|
280 |
prompt = gr.Textbox(
|
281 |
+
label="1. Prompt",
|
282 |
placeholder="Enter your prompt",
|
283 |
lines=2,
|
284 |
value="coffee in a cup bokeh --ar 85:128 --v 6.0 --style raw5, 4K, 리얼리티 사진"
|
285 |
)
|
286 |
with gr.Row():
|
287 |
text_for_image = gr.Textbox(
|
288 |
+
label="2. Text for Image Generation",
|
289 |
placeholder="Enter text to be converted into an image",
|
290 |
lines=3,
|
291 |
value="대한 萬世 GO"
|
292 |
)
|
293 |
with gr.Row():
|
294 |
with gr.Column():
|
295 |
+
gr.Markdown("3. Text Position")
|
296 |
with gr.Row(elem_classes="text-position-grid"):
|
297 |
position_buttons = [gr.Button("•") for _ in range(25)]
|
298 |
|
|
|
301 |
btn.click(update_button_states, inputs=[text_position], outputs=position_buttons)
|
302 |
with gr.Column():
|
303 |
font_size = gr.Slider(
|
304 |
+
label="4. Text Size",
|
305 |
minimum=12,
|
306 |
maximum=144,
|
307 |
step=1,
|
308 |
value=72
|
309 |
)
|
310 |
with gr.Row():
|
311 |
+
font_dropdown = gr.Dropdown(choices=get_font_files(), label="5. Select Font(Option)", value="Arial_Unicode.ttf")
|
312 |
|
313 |
with gr.Row():
|
314 |
preview_text = gr.Textbox(label="Preview Text", value="Hello, World!")
|
|
|
316 |
|
317 |
font_preview = gr.Image(label="Font Preview")
|
318 |
|
319 |
+
with gr.Accordion("6. Advanced Settings(Option)", open=False):
|
320 |
negative_prompt = gr.Textbox(
|
321 |
label="Negative prompt",
|
322 |
placeholder="Enter a negative prompt",
|