Eugeoter commited on
Commit
a8eb6d6
1 Parent(s): c027592
Files changed (3) hide show
  1. app.py +13 -0
  2. examples/example_1.jpg +0 -0
  3. tmp.py +7 -0
app.py CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
2
  import torch
3
  import numpy as np
4
  import spaces
 
5
  from huggingface_hub import hf_hub_download
6
  from utils import utils, tools, preprocess
7
 
@@ -113,6 +114,18 @@ def ui():
113
  show_share_button=True,
114
  )
115
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  @spaces.GPU
117
  def generate(
118
  prompt,
 
2
  import torch
3
  import numpy as np
4
  import spaces
5
+ from PIL import Image
6
  from huggingface_hub import hf_hub_download
7
  from utils import utils, tools, preprocess
8
 
 
114
  show_share_button=True,
115
  )
116
 
117
+ with gr.Row():
118
+ example = gr.Examples(
119
+ examples=[
120
+ 'best quality, 1girl, solo, open hand, outdoors, street',
121
+ Image.open('examples/example_1.jpg'),
122
+ ],
123
+ inputs=[
124
+ prompt,
125
+ control_image,
126
+ ]
127
+ )
128
+
129
  @spaces.GPU
130
  def generate(
131
  prompt,
examples/example_1.jpg ADDED
tmp.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ from PIL import Image
2
+ import cv2
3
+ import numpy as np
4
+
5
+
6
+ image = Image.open(r"C:\Users\15070\Desktop\projects\spaces\ControlNeXt\examples\image - 2024-08-19T170045.514.png")
7
+ image.save(r"C:\Users\15070\Desktop\projects\spaces\ControlNeXt\examples\image - 2024-08-19T170045.514.jpg", quality=90)