hysts HF staff commited on
Commit
15b0708
1 Parent(s): 333cb7d

gradio==4.1.1

Browse files
Files changed (4) hide show
  1. README.md +1 -1
  2. app_stylization.py +9 -8
  3. app_zero_shot.py +8 -7
  4. requirements.txt +6 -6
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🔥
4
  colorFrom: yellow
5
  colorTo: indigo
6
  sdk: gradio
7
- sdk_version: 3.47.1
8
  app_file: app.py
9
  pinned: false
10
  suggested_hardware: t4-small
 
4
  colorFrom: yellow
5
  colorTo: indigo
6
  sdk: gradio
7
+ sdk_version: 4.1.1
8
  app_file: app.py
9
  pinned: false
10
  suggested_hardware: t4-small
app_stylization.py CHANGED
@@ -53,13 +53,12 @@ def run(
53
  with gr.Blocks() as demo:
54
  with gr.Row():
55
  with gr.Column():
56
- with gr.Box():
57
- condition_image = gr.Image(label="Condition Image")
58
- style_image = gr.Image(label="Style Image")
59
- condition_subject = gr.Textbox(label="Condition Subject")
60
- style_subject = gr.Textbox(label="Style Subject")
61
- prompt = gr.Textbox(label="Prompt")
62
- run_button = gr.Button()
63
  with gr.Accordion(label="Advanced options", open=False):
64
  negative_prompt = gr.Textbox(label="Negative Prompt", value=DEFAULT_NEGATIVE_PROMPT)
65
  seed = gr.Slider(
@@ -131,13 +130,15 @@ with gr.Blocks() as demo:
131
  fn=randomize_seed_fn,
132
  inputs=[seed, randomize_seed],
133
  outputs=seed,
134
- queue=False,
135
  api_name=False,
 
136
  ).then(
137
  fn=run,
138
  inputs=inputs,
139
  outputs=result,
140
  api_name="run-stylization",
 
 
141
  )
142
 
143
  if __name__ == "__main__":
 
53
  with gr.Blocks() as demo:
54
  with gr.Row():
55
  with gr.Column():
56
+ condition_image = gr.Image(label="Condition Image")
57
+ style_image = gr.Image(label="Style Image")
58
+ condition_subject = gr.Textbox(label="Condition Subject")
59
+ style_subject = gr.Textbox(label="Style Subject")
60
+ prompt = gr.Textbox(label="Prompt")
61
+ run_button = gr.Button()
 
62
  with gr.Accordion(label="Advanced options", open=False):
63
  negative_prompt = gr.Textbox(label="Negative Prompt", value=DEFAULT_NEGATIVE_PROMPT)
64
  seed = gr.Slider(
 
130
  fn=randomize_seed_fn,
131
  inputs=[seed, randomize_seed],
132
  outputs=seed,
 
133
  api_name=False,
134
+ concurrency_limit=None,
135
  ).then(
136
  fn=run,
137
  inputs=inputs,
138
  outputs=result,
139
  api_name="run-stylization",
140
+ concurrency_id="gpu",
141
+ concurrency_limit=1,
142
  )
143
 
144
  if __name__ == "__main__":
app_zero_shot.py CHANGED
@@ -46,12 +46,11 @@ def run(
46
  with gr.Blocks() as demo:
47
  with gr.Row():
48
  with gr.Column():
49
- with gr.Box():
50
- condition_image = gr.Image(label="Condition Image")
51
- condition_subject = gr.Textbox(label="Condition Subject")
52
- target_subject = gr.Textbox(label="Target Subject")
53
- prompt = gr.Textbox(label="Prompt")
54
- run_button = gr.Button()
55
  with gr.Accordion(label="Advanced options", open=False):
56
  negative_prompt = gr.Textbox(label="Negative Prompt", value=DEFAULT_NEGATIVE_PROMPT)
57
  seed = gr.Slider(
@@ -120,13 +119,15 @@ with gr.Blocks() as demo:
120
  fn=randomize_seed_fn,
121
  inputs=[seed, randomize_seed],
122
  outputs=seed,
123
- queue=False,
124
  api_name=False,
 
125
  ).then(
126
  fn=run,
127
  inputs=inputs,
128
  outputs=result,
129
  api_name="run-zero-shot",
 
 
130
  )
131
 
132
  if __name__ == "__main__":
 
46
  with gr.Blocks() as demo:
47
  with gr.Row():
48
  with gr.Column():
49
+ condition_image = gr.Image(label="Condition Image")
50
+ condition_subject = gr.Textbox(label="Condition Subject")
51
+ target_subject = gr.Textbox(label="Target Subject")
52
+ prompt = gr.Textbox(label="Prompt")
53
+ run_button = gr.Button()
 
54
  with gr.Accordion(label="Advanced options", open=False):
55
  negative_prompt = gr.Textbox(label="Negative Prompt", value=DEFAULT_NEGATIVE_PROMPT)
56
  seed = gr.Slider(
 
119
  fn=randomize_seed_fn,
120
  inputs=[seed, randomize_seed],
121
  outputs=seed,
 
122
  api_name=False,
123
+ concurrency_limit=None,
124
  ).then(
125
  fn=run,
126
  inputs=inputs,
127
  outputs=result,
128
  api_name="run-zero-shot",
129
+ concurrency_id="gpu",
130
+ concurrency_limit=1,
131
  )
132
 
133
  if __name__ == "__main__":
requirements.txt CHANGED
@@ -1,9 +1,9 @@
1
- accelerate==0.23.0
2
  controlnet_aux==0.0.7
3
- git+https://github.com/huggingface/diffusers@5b11c5d
4
- gradio==3.47.1
5
- Pillow==10.0.1
6
- spaces==0.16.1
7
  torch==2.0.0
8
  torchvision==0.15.1
9
- transformers==4.34.0
 
1
+ accelerate==0.24.1
2
  controlnet_aux==0.0.7
3
+ git+https://github.com/huggingface/diffusers@dd9a5ca
4
+ gradio==4.1.1
5
+ Pillow==10.1.0
6
+ spaces==0.18.0
7
  torch==2.0.0
8
  torchvision==0.15.1
9
+ transformers==4.35.0