DigiP-AI commited on
Commit
424f043
·
verified ·
1 Parent(s): 4d8e754

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -28
app.py CHANGED
@@ -1,10 +1,7 @@
1
  import gradio as gr
2
  import cv2
3
  import numpy as np
4
- import torch
5
  from datetime import datetime
6
- from diffusers import DiffusionPipeline
7
- from transformers import pipeline
8
  import random
9
 
10
  #----------Start of theme----------
@@ -287,31 +284,17 @@ css = """
287
  with gr.Blocks(theme=theme, css=css) as app:
288
  gr.HTML("<center><h6>🎨 Image Studio</h6></center>")
289
  with gr.Tab("Text to Image"):
290
- # gr.load("models/digiplay/AnalogMadness-realistic-model-v7")
291
- #gr.load("models/XLabs-AI/flux-RealismLora")
292
- # Load the text-to-image model from Hugging Face
293
- generator = pipeline("text-to-image", model="XLabs-AI/flux-RealismLora")
294
-
295
- # Define the generation function
296
- def generate_image(prompt):
297
- result = generator(prompt)
298
- return result[0]['generated_image']
299
-
300
- # Set up the Gradio Interface
301
- demo = gr.Interface(
302
- fn=generate_image,
303
- inputs=gr.Textbox(label="Enter a prompt for the image"),
304
- outputs=gr.Image(label="Generated Image"),
305
- title="Text-to-Image Generation with Flux-RealismLora",
306
- description="Enter a text prompt to generate a realistic image using the XLabs-AI/flux-RealismLora model."
307
- )
308
  with gr.Tab("Flip Image"):
309
- with gr.Row():
310
- image_input = gr.Image(type="numpy", label="Upload Image")
311
- image_output = gr.Image(format="png")
312
- with gr.Row():
313
- image_button = gr.Button("Run", variant='primary')
314
- image_button.click(flip_image, inputs=image_input, outputs=image_output)
 
315
  with gr.Tab("Image Filters"):
316
  with gr.Row():
317
  with gr.Column():
@@ -347,4 +330,4 @@ demo = gr.Interface(
347
  )
348
 
349
 
350
- app.launch(share=False)
 
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----------
 
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.load("models/digiplay/AnalogMadness-realistic-model-v7")
288
+ gr.load("models/XLabs-AI/flux-RealismLora")
289
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  with gr.Tab("Flip Image"):
291
+ with gr.Row():
292
+ image_input = gr.Image(type="numpy", label="Upload Image")
293
+ image_output = gr.Image(format="png")
294
+ with gr.Row():
295
+ image_button = gr.Button("Run", variant='primary')
296
+ image_button.click(flip_image, inputs=image_input, outputs=image_output)
297
+
298
  with gr.Tab("Image Filters"):
299
  with gr.Row():
300
  with gr.Column():
 
330
  )
331
 
332
 
333
+ app.launch(share=True)