ChongMou radames commited on
Commit
3996268
1 Parent(s): dbae8e2

Speed improvements and possible error fix (#2)

Browse files

- Speed improvements and possible error fix (98e99abd0eba8a6ea507a8c1eb4455023534e829)
- add memory status back (6bf9393a97dc36a1c8927f379ade5fca28be70ce)
- Merge branch 'main' into pr/2 (742c88ec3dd5088470673b25b39c19bd2d615027)


Co-authored-by: Radamés Ajna <[email protected]>

Files changed (4) hide show
  1. README.md +2 -2
  2. app.py +6 -6
  3. demo/demos.py +7 -8
  4. requirements.txt +7 -1
README.md CHANGED
@@ -2,11 +2,11 @@
2
  license: openrail
3
  title: T2I-Adapter
4
  sdk: gradio
5
- sdk_version: 3.11
6
  emoji: 😻
7
  colorFrom: pink
8
  colorTo: blue
9
  pinned: false
10
  python_version: 3.8.16
11
  app_file: app.py
12
- ---
 
2
  license: openrail
3
  title: T2I-Adapter
4
  sdk: gradio
5
+ sdk_version: 3.19.1
6
  emoji: 😻
7
  colorFrom: pink
8
  colorTo: blue
9
  pinned: false
10
  python_version: 3.8.16
11
  app_file: app.py
12
+ ---
app.py CHANGED
@@ -1,10 +1,10 @@
1
  import os
2
- os.system('pip3 install openmim')
3
  os.system('mim install mmcv-full==1.7.0')
4
- os.system('pip3 install mmpose')
5
- os.system('pip3 install mmdet')
6
- os.system('pip3 install gradio==3.19.1')
7
- os.system('pip3 install psutil')
8
 
9
  from demo.model import Model_all
10
  import gradio as gr
@@ -65,4 +65,4 @@ with gr.Blocks(css='style.css') as demo:
65
 
66
  # demo.queue(api_open=False).launch(server_name='0.0.0.0')
67
  # demo.queue(show_api=False, enable_queue=False).launch(server_name='0.0.0.0')
68
- demo.queue().launch(debug=True)
 
1
  import os
2
+ # os.system('pip3 install openmim')
3
  os.system('mim install mmcv-full==1.7.0')
4
+ # os.system('pip3 install mmpose')
5
+ # os.system('pip3 install mmdet')
6
+ # os.system('pip3 install gradio==3.19.1')
7
+ #os.system('pip3 install psutil')
8
 
9
  from demo.model import Model_all
10
  import gradio as gr
 
65
 
66
  # demo.queue(api_open=False).launch(server_name='0.0.0.0')
67
  # demo.queue(show_api=False, enable_queue=False).launch(server_name='0.0.0.0')
68
+ demo.queue().launch(debug=True, server_name='0.0.0.0')
demo/demos.py CHANGED
@@ -18,6 +18,12 @@ def create_demo_keypose(process):
18
  with gr.Blocks() as demo:
19
  with gr.Row():
20
  gr.Markdown('T2I-Adapter (Keypose)')
 
 
 
 
 
 
21
  with gr.Row():
22
  with gr.Column():
23
  input_img = gr.Image(source='upload', type="numpy")
@@ -43,13 +49,6 @@ def create_demo_sketch(process):
43
  with gr.Blocks() as demo:
44
  with gr.Row():
45
  gr.Markdown('T2I-Adapter (Sketch)')
46
-
47
- with gr.Row():
48
- with gr.Column():
49
- gr.Textbox(value="Hello Memory")
50
- with gr.Column():
51
- gr.JSON(get_system_memory, every=1)
52
-
53
  with gr.Row():
54
  with gr.Column():
55
  input_img = gr.Image(source='upload', type="numpy")
@@ -80,7 +79,7 @@ def create_demo_draw(process):
80
  with gr.Column():
81
  create_button = gr.Button(label="Start", value='Hand-free drawing')
82
  input_img = gr.Image(source='upload', type="numpy",tool='sketch')
83
- create_button.click(fn=create_map, outputs=[input_img])
84
  prompt = gr.Textbox(label="Prompt")
85
  neg_prompt = gr.Textbox(label="Negative Prompt",
86
  value='ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, bad anatomy, watermark, signature, cut off, low contrast, underexposed, overexposed, bad art, beginner, amateur, distorted face')
 
18
  with gr.Blocks() as demo:
19
  with gr.Row():
20
  gr.Markdown('T2I-Adapter (Keypose)')
21
+ with gr.Row():
22
+ with gr.Column():
23
+ gr.Textbox(value="Hello Memory")
24
+ with gr.Column():
25
+ gr.JSON(get_system_memory, every=1)
26
+
27
  with gr.Row():
28
  with gr.Column():
29
  input_img = gr.Image(source='upload', type="numpy")
 
49
  with gr.Blocks() as demo:
50
  with gr.Row():
51
  gr.Markdown('T2I-Adapter (Sketch)')
 
 
 
 
 
 
 
52
  with gr.Row():
53
  with gr.Column():
54
  input_img = gr.Image(source='upload', type="numpy")
 
79
  with gr.Column():
80
  create_button = gr.Button(label="Start", value='Hand-free drawing')
81
  input_img = gr.Image(source='upload', type="numpy",tool='sketch')
82
+ create_button.click(fn=create_map, outputs=[input_img], queue=False)
83
  prompt = gr.Textbox(label="Prompt")
84
  neg_prompt = gr.Textbox(label="Negative Prompt",
85
  value='ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, bad anatomy, watermark, signature, cut off, low contrast, underexposed, overexposed, bad art, beginner, amateur, distorted face')
requirements.txt CHANGED
@@ -9,4 +9,10 @@ omegaconf==2.3.0
9
  taming-transformers-rom1504==0.0.6
10
  pytorch_lightning==1.8.6
11
  clip==0.2.0
12
- kornia==0.6.8
 
 
 
 
 
 
 
9
  taming-transformers-rom1504==0.0.6
10
  pytorch_lightning==1.8.6
11
  clip==0.2.0
12
+ kornia==0.6.8
13
+
14
+
15
+ openmim
16
+ mmpose
17
+ mmdet
18
+ psutil