Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,8 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import cv2
|
| 3 |
import numpy as np
|
| 4 |
-
import os
|
| 5 |
from datetime import datetime
|
| 6 |
import random
|
| 7 |
-
from transformers import pipeline
|
| 8 |
-
import torch
|
| 9 |
-
from diffusers import FluxPipeline
|
| 10 |
|
| 11 |
#----------Start of theme----------
|
| 12 |
theme = gr.themes.Soft(
|
|
@@ -42,12 +38,6 @@ theme = gr.themes.Soft(
|
|
| 42 |
)
|
| 43 |
#----------End of theme----------
|
| 44 |
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
API_TOKEN = os.getenv("HF_READ_TOKEN")
|
| 48 |
-
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
| 49 |
-
timeout = 100
|
| 50 |
-
|
| 51 |
def flip_image(x):
|
| 52 |
return np.fliplr(x)
|
| 53 |
|
|
@@ -280,6 +270,7 @@ def image_processing(image, filter_type):
|
|
| 280 |
output = image
|
| 281 |
|
| 282 |
return cv2.cvtColor(output, cv2.COLOR_BGR2RGB) if len(output.shape) == 3 else output
|
|
|
|
| 283 |
|
| 284 |
css = """
|
| 285 |
#app-container {
|
|
@@ -292,17 +283,20 @@ css = """
|
|
| 292 |
# Gradio interface
|
| 293 |
with gr.Blocks(theme=theme, css=css) as app:
|
| 294 |
gr.HTML("<center><h6>🎨 Image Studio</h6></center>")
|
| 295 |
-
|
| 296 |
#gr.HTML("<center><b>Flux</b></center>")
|
| 297 |
#gr.load("models/XLabs-AI/flux-RealismLora")
|
| 298 |
#gr.load("models/digiplay/AnalogMadness-realistic-model-v7")
|
| 299 |
#gr.load("stabilityai/stable-diffusion-3-medium-diffusers")
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
with gr.
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
|
|
|
|
|
|
|
|
|
| 306 |
with gr.Row():
|
| 307 |
image_button = gr.Button("Run", variant='primary')
|
| 308 |
image_button.click(flip_image, inputs=image_input, outputs=image_output)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import cv2
|
| 3 |
import numpy as np
|
|
|
|
| 4 |
from datetime import datetime
|
| 5 |
import random
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
#----------Start of theme----------
|
| 8 |
theme = gr.themes.Soft(
|
|
|
|
| 38 |
)
|
| 39 |
#----------End of theme----------
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
def flip_image(x):
|
| 42 |
return np.fliplr(x)
|
| 43 |
|
|
|
|
| 270 |
output = image
|
| 271 |
|
| 272 |
return cv2.cvtColor(output, cv2.COLOR_BGR2RGB) if len(output.shape) == 3 else output
|
| 273 |
+
|
| 274 |
|
| 275 |
css = """
|
| 276 |
#app-container {
|
|
|
|
| 283 |
# Gradio interface
|
| 284 |
with gr.Blocks(theme=theme, css=css) as app:
|
| 285 |
gr.HTML("<center><h6>🎨 Image Studio</h6></center>")
|
| 286 |
+
with gr.Tab("Text to Image"):
|
| 287 |
#gr.HTML("<center><b>Flux</b></center>")
|
| 288 |
#gr.load("models/XLabs-AI/flux-RealismLora")
|
| 289 |
#gr.load("models/digiplay/AnalogMadness-realistic-model-v7")
|
| 290 |
#gr.load("stabilityai/stable-diffusion-3-medium-diffusers")
|
| 291 |
+
gr.load("models/dvyio/flux-lora-film-noir")
|
| 292 |
+
with gr.Tab("Flip Image"):
|
| 293 |
+
with gr.Row():
|
| 294 |
+
image_input = gr.Image(type="numpy", label="Upload Image")
|
| 295 |
+
image_output = gr.Image(format="png")
|
| 296 |
+
with gr.Row():
|
| 297 |
+
image_button = gr.Button("Run", variant='primary')
|
| 298 |
+
image_button.click(flip_image, inputs=image_input, outputs=image_output)
|
| 299 |
+
|
| 300 |
with gr.Row():
|
| 301 |
image_button = gr.Button("Run", variant='primary')
|
| 302 |
image_button.click(flip_image, inputs=image_input, outputs=image_output)
|