Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,6 @@ import cv2
|
|
| 3 |
import numpy as np
|
| 4 |
from datetime import datetime
|
| 5 |
import random
|
| 6 |
-
from transformers import pipeline
|
| 7 |
|
| 8 |
#----------Start of theme----------
|
| 9 |
theme = gr.themes.Soft(
|
|
@@ -286,47 +285,37 @@ with gr.Blocks(theme=theme, css=css) as app:
|
|
| 286 |
gr.HTML("<center><h6>🎨 Image Studio</h6></center>")
|
| 287 |
with gr.Tab("Text to Image"):
|
| 288 |
#gr.load("models/digiplay/AnalogMadness-realistic-model-v7")
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
"Charcoal Effect", "Sharpen", "Embossing", "Edge Detection",
|
| 318 |
-
# Creative Filters
|
| 319 |
-
"Rainbow", "Night Vision",
|
| 320 |
-
# Special Effects
|
| 321 |
-
"Matrix Effect", "Wave Effect", "Time Stamp", "Glitch Effect",
|
| 322 |
-
# Artistic Filters
|
| 323 |
-
"Pop Art", "Oil Paint", "Cartoon",
|
| 324 |
-
# Atmospheric Filters
|
| 325 |
-
"Autumn", "Increase Brightness"
|
| 326 |
-
],
|
| 327 |
label="🎭 Select Filter",
|
| 328 |
info="Choose the effect you want"
|
| 329 |
-
)
|
| 330 |
submit_button = gr.Button("✨ Apply Filter", variant="primary")
|
| 331 |
|
| 332 |
with gr.Column():
|
|
@@ -337,17 +326,16 @@ with gr.Tab("Image Filters"):
|
|
| 337 |
inputs=[image_input, filter_type],
|
| 338 |
outputs=image_output
|
| 339 |
)
|
| 340 |
-
with gr.Tab("Image Upscaler"):
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
|
| 348 |
radio_input = gr.Radio(label="Upscale Levels", choices=[2, 4, 6, 8, 10], value=2)
|
| 349 |
|
| 350 |
iface = gr.Interface(fn=upscale_image, inputs = [gr.Image(label="Input Image", interactive=True), radio_input], outputs = gr.Image(label="Upscaled Image", format="png"), title="Image Upscaler")
|
| 351 |
|
| 352 |
-
app.launch(share=
|
| 353 |
-
|
|
|
|
| 3 |
import numpy as np
|
| 4 |
from datetime import datetime
|
| 5 |
import random
|
|
|
|
| 6 |
|
| 7 |
#----------Start of theme----------
|
| 8 |
theme = gr.themes.Soft(
|
|
|
|
| 285 |
gr.HTML("<center><h6>🎨 Image Studio</h6></center>")
|
| 286 |
with gr.Tab("Text to Image"):
|
| 287 |
#gr.load("models/digiplay/AnalogMadness-realistic-model-v7")
|
| 288 |
+
gr.load("models/XLabs-AI/flux-RealismLora")
|
| 289 |
+
with gr.Tab("Flip Image"):
|
| 290 |
+
with gr.Row():
|
| 291 |
+
image_input = gr.Image(type="numpy", label="Upload Image")
|
| 292 |
+
image_output = gr.Image(format="png")
|
| 293 |
+
with gr.Row():
|
| 294 |
+
image_button = gr.Button("Run", variant='primary')
|
| 295 |
+
image_button.click(flip_image, inputs=image_input, outputs=image_output)
|
| 296 |
+
with gr.Tab("Image Filters"):
|
| 297 |
+
with gr.Row():
|
| 298 |
+
with gr.Column():
|
| 299 |
+
image_input = gr.Image(type="numpy", label="Upload Image")
|
| 300 |
+
with gr.Accordion("ℹ️ Filter Categories", open=True):
|
| 301 |
+
filter_type = gr.Dropdown(
|
| 302 |
+
[
|
| 303 |
+
# Basic Filters
|
| 304 |
+
"Gray Toning", "Sepia", "X-ray", "Burn it",
|
| 305 |
+
# Classic Filter
|
| 306 |
+
"Charcoal Effect", "Sharpen", "Embossing", "Edge Detection",
|
| 307 |
+
# Creative Filters
|
| 308 |
+
"Rainbow", "Night Vision",
|
| 309 |
+
# Special Effects
|
| 310 |
+
"Matrix Effect", "Wave Effect", "Time Stamp", "Glitch Effect",
|
| 311 |
+
# Artistic Filters
|
| 312 |
+
"Pop Art", "Oil Paint", "Cartoon",
|
| 313 |
+
# Atmospheric Filters
|
| 314 |
+
"Autumn", "Increase Brightness"
|
| 315 |
+
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 316 |
label="🎭 Select Filter",
|
| 317 |
info="Choose the effect you want"
|
| 318 |
+
)
|
| 319 |
submit_button = gr.Button("✨ Apply Filter", variant="primary")
|
| 320 |
|
| 321 |
with gr.Column():
|
|
|
|
| 326 |
inputs=[image_input, filter_type],
|
| 327 |
outputs=image_output
|
| 328 |
)
|
| 329 |
+
with gr.Tab("Image Upscaler"):
|
| 330 |
+
with gr.Row():
|
| 331 |
+
with gr.Column():
|
| 332 |
+
def upscale_image(input_image, radio_input):
|
| 333 |
+
upscale_factor = radio_input
|
| 334 |
+
output_image = cv2.resize(input_image, None, fx = upscale_factor, fy = upscale_factor, interpolation = cv2.INTER_CUBIC)
|
| 335 |
+
return output_image
|
| 336 |
|
| 337 |
radio_input = gr.Radio(label="Upscale Levels", choices=[2, 4, 6, 8, 10], value=2)
|
| 338 |
|
| 339 |
iface = gr.Interface(fn=upscale_image, inputs = [gr.Image(label="Input Image", interactive=True), radio_input], outputs = gr.Image(label="Upscaled Image", format="png"), title="Image Upscaler")
|
| 340 |
|
| 341 |
+
app.launch(share=True)
|
|
|