abdullahalioo commited on
Commit
0b8ddfd
·
verified ·
1 Parent(s): c0c232b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -1,17 +1,17 @@
1
  import gradio as gr
2
- from transformers import pipeline
3
 
4
- # Load the ZenCtrl tool pipeline for image enhancement
5
- enhancer = pipeline(model="fotographerai/zenctrl_tools")
6
 
7
- def enhance_image(input_image):
8
  # Enhance the image using the model
9
- enhanced_image = enhancer(input_image)
10
  return enhanced_image
11
 
12
  # Set up the Gradio interface
13
  interface = gr.Interface(
14
- fn=enhance_image,
15
  inputs=gr.Image(type="pil", label="Upload Image to Enhance"),
16
  outputs=gr.Image(type="pil", label="Enhanced Image"),
17
  title="Image Enhancement with ZenCtrl",
 
1
  import gradio as gr
2
+ from diffusion_single_file import load_model, enhance_image
3
 
4
+ # Load the ZenCtrl model using the correct library
5
+ model = load_model("fotographerai/zenctrl_tools")
6
 
7
+ def enhance_image_fn(input_image):
8
  # Enhance the image using the model
9
+ enhanced_image = enhance_image(model, input_image)
10
  return enhanced_image
11
 
12
  # Set up the Gradio interface
13
  interface = gr.Interface(
14
+ fn=enhance_image_fn,
15
  inputs=gr.Image(type="pil", label="Upload Image to Enhance"),
16
  outputs=gr.Image(type="pil", label="Enhanced Image"),
17
  title="Image Enhancement with ZenCtrl",