Files changed (3) hide show
  1. README.md +5 -2
  2. edit_app.py +5 -3
  3. requirements.txt +1 -0
README.md CHANGED
@@ -1,7 +1,7 @@
1
  ---
2
  title: InstructPix2Pix
3
  sdk: gradio
4
- sdk_version: 6.14.0
5
  app_file: edit_app.py
6
  pinned: true
7
  ---
@@ -210,4 +210,7 @@ If you're not getting the quality result you want, there may be a few reasons:
210
  journal={arXiv preprint arXiv:2211.09800},
211
  year={2022}
212
  }
213
- ```
 
 
 
 
1
  ---
2
  title: InstructPix2Pix
3
  sdk: gradio
4
+ sdk_version: 3.16.2
5
  app_file: edit_app.py
6
  pinned: true
7
  ---
 
210
  journal={arXiv preprint arXiv:2211.09800},
211
  year={2022}
212
  }
213
+ ```
214
+
215
+
216
+
edit_app.py CHANGED
@@ -1,5 +1,5 @@
1
  from __future__ import annotations
2
- import spaces
3
  import math
4
  import random
5
 
@@ -69,7 +69,7 @@ def main():
69
  text_cfg_scale,
70
  image_cfg_scale,
71
  )
72
- @spaces.GPU
73
  def generate(
74
  input_image: Image.Image,
75
  instruction: str,
@@ -127,6 +127,8 @@ def main():
127
  with gr.Row():
128
  input_image = gr.Image(label="Input Image", type="pil", interactive=True)
129
  edited_image = gr.Image(label=f"Edited Image", type="pil", interactive=False)
 
 
130
 
131
  with gr.Row():
132
  steps = gr.Number(value=50, precision=0, label="Steps", interactive=True)
@@ -182,7 +184,7 @@ def main():
182
  outputs=[steps, randomize_seed, seed, randomize_cfg, text_cfg_scale, image_cfg_scale, edited_image],
183
  )
184
 
185
- demo.queue()
186
  demo.launch(share=False)
187
 
188
 
 
1
  from __future__ import annotations
2
+
3
  import math
4
  import random
5
 
 
69
  text_cfg_scale,
70
  image_cfg_scale,
71
  )
72
+
73
  def generate(
74
  input_image: Image.Image,
75
  instruction: str,
 
127
  with gr.Row():
128
  input_image = gr.Image(label="Input Image", type="pil", interactive=True)
129
  edited_image = gr.Image(label=f"Edited Image", type="pil", interactive=False)
130
+ input_image.style(height=512, width=512)
131
+ edited_image.style(height=512, width=512)
132
 
133
  with gr.Row():
134
  steps = gr.Number(value=50, precision=0, label="Steps", interactive=True)
 
184
  outputs=[steps, randomize_seed, seed, randomize_cfg, text_cfg_scale, image_cfg_scale, edited_image],
185
  )
186
 
187
+ demo.queue(concurrency_count=1)
188
  demo.launch(share=False)
189
 
190
 
requirements.txt CHANGED
@@ -1,3 +1,4 @@
 
1
  torch
2
  torchvision
3
  numpy
 
1
+ -f --extra-index-url https://download.pytorch.org/whl/cu116
2
  torch
3
  torchvision
4
  numpy