hysts HF staff commited on
Commit
d5479f6
β€’
1 Parent(s): 566c28a
app_canny.py CHANGED
@@ -2,7 +2,8 @@
2
 
3
  import gradio as gr
4
 
5
- from settings import DEFAULT_NUM_IMAGES, MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES
 
6
  from utils import randomize_seed_fn
7
 
8
 
@@ -19,11 +20,12 @@ def create_demo(process):
19
  maximum=MAX_NUM_IMAGES,
20
  value=DEFAULT_NUM_IMAGES,
21
  step=1)
22
- image_resolution = gr.Slider(label='Image resolution',
23
- minimum=256,
24
- maximum=MAX_IMAGE_RESOLUTION,
25
- value=512,
26
- step=256)
 
27
  canny_low_threshold = gr.Slider(
28
  label='Canny low threshold',
29
  minimum=1,
 
2
 
3
  import gradio as gr
4
 
5
+ from settings import (DEFAULT_IMAGE_RESOLUTION, DEFAULT_NUM_IMAGES,
6
+ MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES)
7
  from utils import randomize_seed_fn
8
 
9
 
 
20
  maximum=MAX_NUM_IMAGES,
21
  value=DEFAULT_NUM_IMAGES,
22
  step=1)
23
+ image_resolution = gr.Slider(
24
+ label='Image resolution',
25
+ minimum=256,
26
+ maximum=MAX_IMAGE_RESOLUTION,
27
+ value=DEFAULT_IMAGE_RESOLUTION,
28
+ step=256)
29
  canny_low_threshold = gr.Slider(
30
  label='Canny low threshold',
31
  minimum=1,
app_depth.py CHANGED
@@ -2,7 +2,8 @@
2
 
3
  import gradio as gr
4
 
5
- from settings import DEFAULT_NUM_IMAGES, MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES
 
6
  from utils import randomize_seed_fn
7
 
8
 
@@ -24,11 +25,12 @@ def create_demo(process):
24
  maximum=MAX_NUM_IMAGES,
25
  value=DEFAULT_NUM_IMAGES,
26
  step=1)
27
- image_resolution = gr.Slider(label='Image resolution',
28
- minimum=256,
29
- maximum=MAX_IMAGE_RESOLUTION,
30
- value=512,
31
- step=256)
 
32
  preprocess_resolution = gr.Slider(
33
  label='Preprocess resolution',
34
  minimum=128,
 
2
 
3
  import gradio as gr
4
 
5
+ from settings import (DEFAULT_IMAGE_RESOLUTION, DEFAULT_NUM_IMAGES,
6
+ MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES)
7
  from utils import randomize_seed_fn
8
 
9
 
 
25
  maximum=MAX_NUM_IMAGES,
26
  value=DEFAULT_NUM_IMAGES,
27
  step=1)
28
+ image_resolution = gr.Slider(
29
+ label='Image resolution',
30
+ minimum=256,
31
+ maximum=MAX_IMAGE_RESOLUTION,
32
+ value=DEFAULT_IMAGE_RESOLUTION,
33
+ step=256)
34
  preprocess_resolution = gr.Slider(
35
  label='Preprocess resolution',
36
  minimum=128,
app_ip2p.py CHANGED
@@ -2,7 +2,8 @@
2
 
3
  import gradio as gr
4
 
5
- from settings import DEFAULT_NUM_IMAGES, MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES
 
6
  from utils import randomize_seed_fn
7
 
8
 
@@ -19,11 +20,12 @@ def create_demo(process):
19
  maximum=MAX_NUM_IMAGES,
20
  value=DEFAULT_NUM_IMAGES,
21
  step=1)
22
- image_resolution = gr.Slider(label='Image resolution',
23
- minimum=256,
24
- maximum=MAX_IMAGE_RESOLUTION,
25
- value=512,
26
- step=256)
 
27
  num_steps = gr.Slider(label='Number of steps',
28
  minimum=1,
29
  maximum=100,
 
2
 
3
  import gradio as gr
4
 
5
+ from settings import (DEFAULT_IMAGE_RESOLUTION, DEFAULT_NUM_IMAGES,
6
+ MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES)
7
  from utils import randomize_seed_fn
8
 
9
 
 
20
  maximum=MAX_NUM_IMAGES,
21
  value=DEFAULT_NUM_IMAGES,
22
  step=1)
23
+ image_resolution = gr.Slider(
24
+ label='Image resolution',
25
+ minimum=256,
26
+ maximum=MAX_IMAGE_RESOLUTION,
27
+ value=DEFAULT_IMAGE_RESOLUTION,
28
+ step=256)
29
  num_steps = gr.Slider(label='Number of steps',
30
  minimum=1,
31
  maximum=100,
app_lineart.py CHANGED
@@ -2,7 +2,8 @@
2
 
3
  import gradio as gr
4
 
5
- from settings import DEFAULT_NUM_IMAGES, MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES
 
6
  from utils import randomize_seed_fn
7
 
8
 
@@ -33,11 +34,12 @@ def create_demo(process):
33
  maximum=MAX_NUM_IMAGES,
34
  value=DEFAULT_NUM_IMAGES,
35
  step=1)
36
- image_resolution = gr.Slider(label='Image resolution',
37
- minimum=256,
38
- maximum=MAX_IMAGE_RESOLUTION,
39
- value=512,
40
- step=256)
 
41
  preprocess_resolution = gr.Slider(
42
  label='Preprocess resolution',
43
  minimum=128,
 
2
 
3
  import gradio as gr
4
 
5
+ from settings import (DEFAULT_IMAGE_RESOLUTION, DEFAULT_NUM_IMAGES,
6
+ MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES)
7
  from utils import randomize_seed_fn
8
 
9
 
 
34
  maximum=MAX_NUM_IMAGES,
35
  value=DEFAULT_NUM_IMAGES,
36
  step=1)
37
+ image_resolution = gr.Slider(
38
+ label='Image resolution',
39
+ minimum=256,
40
+ maximum=MAX_IMAGE_RESOLUTION,
41
+ value=DEFAULT_IMAGE_RESOLUTION,
42
+ step=256)
43
  preprocess_resolution = gr.Slider(
44
  label='Preprocess resolution',
45
  minimum=128,
app_mlsd.py CHANGED
@@ -2,7 +2,8 @@
2
 
3
  import gradio as gr
4
 
5
- from settings import DEFAULT_NUM_IMAGES, MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES
 
6
  from utils import randomize_seed_fn
7
 
8
 
@@ -19,11 +20,12 @@ def create_demo(process):
19
  maximum=MAX_NUM_IMAGES,
20
  value=DEFAULT_NUM_IMAGES,
21
  step=1)
22
- image_resolution = gr.Slider(label='Image resolution',
23
- minimum=256,
24
- maximum=MAX_IMAGE_RESOLUTION,
25
- value=512,
26
- step=256)
 
27
  preprocess_resolution = gr.Slider(
28
  label='Preprocess resolution',
29
  minimum=128,
 
2
 
3
  import gradio as gr
4
 
5
+ from settings import (DEFAULT_IMAGE_RESOLUTION, DEFAULT_NUM_IMAGES,
6
+ MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES)
7
  from utils import randomize_seed_fn
8
 
9
 
 
20
  maximum=MAX_NUM_IMAGES,
21
  value=DEFAULT_NUM_IMAGES,
22
  step=1)
23
+ image_resolution = gr.Slider(
24
+ label='Image resolution',
25
+ minimum=256,
26
+ maximum=MAX_IMAGE_RESOLUTION,
27
+ value=DEFAULT_IMAGE_RESOLUTION,
28
+ step=256)
29
  preprocess_resolution = gr.Slider(
30
  label='Preprocess resolution',
31
  minimum=128,
app_normal.py CHANGED
@@ -2,7 +2,8 @@
2
 
3
  import gradio as gr
4
 
5
- from settings import DEFAULT_NUM_IMAGES, MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES
 
6
  from utils import randomize_seed_fn
7
 
8
 
@@ -23,11 +24,12 @@ def create_demo(process):
23
  maximum=MAX_NUM_IMAGES,
24
  value=DEFAULT_NUM_IMAGES,
25
  step=1)
26
- image_resolution = gr.Slider(label='Image resolution',
27
- minimum=256,
28
- maximum=MAX_IMAGE_RESOLUTION,
29
- value=512,
30
- step=256)
 
31
  preprocess_resolution = gr.Slider(
32
  label='Preprocess resolution',
33
  minimum=128,
 
2
 
3
  import gradio as gr
4
 
5
+ from settings import (DEFAULT_IMAGE_RESOLUTION, DEFAULT_NUM_IMAGES,
6
+ MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES)
7
  from utils import randomize_seed_fn
8
 
9
 
 
24
  maximum=MAX_NUM_IMAGES,
25
  value=DEFAULT_NUM_IMAGES,
26
  step=1)
27
+ image_resolution = gr.Slider(
28
+ label='Image resolution',
29
+ minimum=256,
30
+ maximum=MAX_IMAGE_RESOLUTION,
31
+ value=DEFAULT_IMAGE_RESOLUTION,
32
+ step=256)
33
  preprocess_resolution = gr.Slider(
34
  label='Preprocess resolution',
35
  minimum=128,
app_openpose.py CHANGED
@@ -2,7 +2,8 @@
2
 
3
  import gradio as gr
4
 
5
- from settings import DEFAULT_NUM_IMAGES, MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES
 
6
  from utils import randomize_seed_fn
7
 
8
 
@@ -23,11 +24,12 @@ def create_demo(process):
23
  maximum=MAX_NUM_IMAGES,
24
  value=DEFAULT_NUM_IMAGES,
25
  step=1)
26
- image_resolution = gr.Slider(label='Image resolution',
27
- minimum=256,
28
- maximum=MAX_IMAGE_RESOLUTION,
29
- value=512,
30
- step=256)
 
31
  preprocess_resolution = gr.Slider(
32
  label='Preprocess resolution',
33
  minimum=128,
 
2
 
3
  import gradio as gr
4
 
5
+ from settings import (DEFAULT_IMAGE_RESOLUTION, DEFAULT_NUM_IMAGES,
6
+ MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES)
7
  from utils import randomize_seed_fn
8
 
9
 
 
24
  maximum=MAX_NUM_IMAGES,
25
  value=DEFAULT_NUM_IMAGES,
26
  step=1)
27
+ image_resolution = gr.Slider(
28
+ label='Image resolution',
29
+ minimum=256,
30
+ maximum=MAX_IMAGE_RESOLUTION,
31
+ value=DEFAULT_IMAGE_RESOLUTION,
32
+ step=256)
33
  preprocess_resolution = gr.Slider(
34
  label='Preprocess resolution',
35
  minimum=128,
app_scribble.py CHANGED
@@ -2,7 +2,8 @@
2
 
3
  import gradio as gr
4
 
5
- from settings import DEFAULT_NUM_IMAGES, MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES
 
6
  from utils import randomize_seed_fn
7
 
8
 
@@ -24,11 +25,12 @@ def create_demo(process):
24
  maximum=MAX_NUM_IMAGES,
25
  value=DEFAULT_NUM_IMAGES,
26
  step=1)
27
- image_resolution = gr.Slider(label='Image resolution',
28
- minimum=256,
29
- maximum=MAX_IMAGE_RESOLUTION,
30
- value=512,
31
- step=256)
 
32
  preprocess_resolution = gr.Slider(
33
  label='Preprocess resolution',
34
  minimum=128,
 
2
 
3
  import gradio as gr
4
 
5
+ from settings import (DEFAULT_IMAGE_RESOLUTION, DEFAULT_NUM_IMAGES,
6
+ MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES)
7
  from utils import randomize_seed_fn
8
 
9
 
 
25
  maximum=MAX_NUM_IMAGES,
26
  value=DEFAULT_NUM_IMAGES,
27
  step=1)
28
+ image_resolution = gr.Slider(
29
+ label='Image resolution',
30
+ minimum=256,
31
+ maximum=MAX_IMAGE_RESOLUTION,
32
+ value=DEFAULT_IMAGE_RESOLUTION,
33
+ step=256)
34
  preprocess_resolution = gr.Slider(
35
  label='Preprocess resolution',
36
  minimum=128,
app_scribble_interactive.py CHANGED
@@ -3,7 +3,8 @@
3
  import gradio as gr
4
  import numpy as np
5
 
6
- from settings import DEFAULT_NUM_IMAGES, MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES
 
7
  from utils import randomize_seed_fn
8
 
9
 
@@ -18,12 +19,12 @@ def create_demo(process):
18
  canvas_width = gr.Slider(label='Canvas width',
19
  minimum=256,
20
  maximum=MAX_IMAGE_RESOLUTION,
21
- value=512,
22
  step=1)
23
  canvas_height = gr.Slider(label='Canvas height',
24
  minimum=256,
25
  maximum=MAX_IMAGE_RESOLUTION,
26
- value=512,
27
  step=1)
28
  create_button = gr.Button('Open drawing canvas!')
29
  image = gr.Image(tool='sketch', brush_radius=10)
@@ -35,11 +36,12 @@ def create_demo(process):
35
  maximum=MAX_NUM_IMAGES,
36
  value=DEFAULT_NUM_IMAGES,
37
  step=1)
38
- image_resolution = gr.Slider(label='Image resolution',
39
- minimum=256,
40
- maximum=MAX_IMAGE_RESOLUTION,
41
- value=512,
42
- step=256)
 
43
  num_steps = gr.Slider(label='Number of steps',
44
  minimum=1,
45
  maximum=100,
 
3
  import gradio as gr
4
  import numpy as np
5
 
6
+ from settings import (DEFAULT_IMAGE_RESOLUTION, DEFAULT_NUM_IMAGES,
7
+ MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES)
8
  from utils import randomize_seed_fn
9
 
10
 
 
19
  canvas_width = gr.Slider(label='Canvas width',
20
  minimum=256,
21
  maximum=MAX_IMAGE_RESOLUTION,
22
+ value=DEFAULT_IMAGE_RESOLUTION,
23
  step=1)
24
  canvas_height = gr.Slider(label='Canvas height',
25
  minimum=256,
26
  maximum=MAX_IMAGE_RESOLUTION,
27
+ value=DEFAULT_IMAGE_RESOLUTION,
28
  step=1)
29
  create_button = gr.Button('Open drawing canvas!')
30
  image = gr.Image(tool='sketch', brush_radius=10)
 
36
  maximum=MAX_NUM_IMAGES,
37
  value=DEFAULT_NUM_IMAGES,
38
  step=1)
39
+ image_resolution = gr.Slider(
40
+ label='Image resolution',
41
+ minimum=256,
42
+ maximum=MAX_IMAGE_RESOLUTION,
43
+ value=DEFAULT_IMAGE_RESOLUTION,
44
+ step=256)
45
  num_steps = gr.Slider(label='Number of steps',
46
  minimum=1,
47
  maximum=100,
app_segmentation.py CHANGED
@@ -2,7 +2,8 @@
2
 
3
  import gradio as gr
4
 
5
- from settings import DEFAULT_NUM_IMAGES, MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES
 
6
  from utils import randomize_seed_fn
7
 
8
 
@@ -23,11 +24,12 @@ def create_demo(process):
23
  maximum=MAX_NUM_IMAGES,
24
  value=DEFAULT_NUM_IMAGES,
25
  step=1)
26
- image_resolution = gr.Slider(label='Image resolution',
27
- minimum=256,
28
- maximum=MAX_IMAGE_RESOLUTION,
29
- value=512,
30
- step=256)
 
31
  preprocess_resolution = gr.Slider(
32
  label='Preprocess resolution',
33
  minimum=128,
 
2
 
3
  import gradio as gr
4
 
5
+ from settings import (DEFAULT_IMAGE_RESOLUTION, DEFAULT_NUM_IMAGES,
6
+ MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES)
7
  from utils import randomize_seed_fn
8
 
9
 
 
24
  maximum=MAX_NUM_IMAGES,
25
  value=DEFAULT_NUM_IMAGES,
26
  step=1)
27
+ image_resolution = gr.Slider(
28
+ label='Image resolution',
29
+ minimum=256,
30
+ maximum=MAX_IMAGE_RESOLUTION,
31
+ value=DEFAULT_IMAGE_RESOLUTION,
32
+ step=256)
33
  preprocess_resolution = gr.Slider(
34
  label='Preprocess resolution',
35
  minimum=128,
app_shuffle.py CHANGED
@@ -2,7 +2,8 @@
2
 
3
  import gradio as gr
4
 
5
- from settings import DEFAULT_NUM_IMAGES, MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES
 
6
  from utils import randomize_seed_fn
7
 
8
 
@@ -24,11 +25,12 @@ def create_demo(process):
24
  maximum=MAX_NUM_IMAGES,
25
  value=DEFAULT_NUM_IMAGES,
26
  step=1)
27
- image_resolution = gr.Slider(label='Image resolution',
28
- minimum=256,
29
- maximum=MAX_IMAGE_RESOLUTION,
30
- value=512,
31
- step=256)
 
32
  num_steps = gr.Slider(label='Number of steps',
33
  minimum=1,
34
  maximum=100,
 
2
 
3
  import gradio as gr
4
 
5
+ from settings import (DEFAULT_IMAGE_RESOLUTION, DEFAULT_NUM_IMAGES,
6
+ MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES)
7
  from utils import randomize_seed_fn
8
 
9
 
 
25
  maximum=MAX_NUM_IMAGES,
26
  value=DEFAULT_NUM_IMAGES,
27
  step=1)
28
+ image_resolution = gr.Slider(
29
+ label='Image resolution',
30
+ minimum=256,
31
+ maximum=MAX_IMAGE_RESOLUTION,
32
+ value=DEFAULT_IMAGE_RESOLUTION,
33
+ step=256)
34
  num_steps = gr.Slider(label='Number of steps',
35
  minimum=1,
36
  maximum=100,
app_softedge.py CHANGED
@@ -2,7 +2,8 @@
2
 
3
  import gradio as gr
4
 
5
- from settings import DEFAULT_NUM_IMAGES, MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES
 
6
  from utils import randomize_seed_fn
7
 
8
 
@@ -29,11 +30,12 @@ def create_demo(process):
29
  maximum=MAX_NUM_IMAGES,
30
  value=DEFAULT_NUM_IMAGES,
31
  step=1)
32
- image_resolution = gr.Slider(label='Image resolution',
33
- minimum=256,
34
- maximum=MAX_IMAGE_RESOLUTION,
35
- value=512,
36
- step=256)
 
37
  preprocess_resolution = gr.Slider(
38
  label='Preprocess resolution',
39
  minimum=128,
 
2
 
3
  import gradio as gr
4
 
5
+ from settings import (DEFAULT_IMAGE_RESOLUTION, DEFAULT_NUM_IMAGES,
6
+ MAX_IMAGE_RESOLUTION, MAX_NUM_IMAGES)
7
  from utils import randomize_seed_fn
8
 
9
 
 
30
  maximum=MAX_NUM_IMAGES,
31
  value=DEFAULT_NUM_IMAGES,
32
  step=1)
33
+ image_resolution = gr.Slider(
34
+ label='Image resolution',
35
+ minimum=256,
36
+ maximum=MAX_IMAGE_RESOLUTION,
37
+ value=DEFAULT_IMAGE_RESOLUTION,
38
+ step=256)
39
  preprocess_resolution = gr.Slider(
40
  label='Preprocess resolution',
41
  minimum=128,
settings.py CHANGED
@@ -7,6 +7,7 @@ MAX_NUM_IMAGES = int(os.getenv('MAX_NUM_IMAGES', '3'))
7
  DEFAULT_NUM_IMAGES = min(MAX_NUM_IMAGES,
8
  int(os.getenv('DEFAULT_NUM_IMAGES', '1')))
9
  MAX_IMAGE_RESOLUTION = int(os.getenv('MAX_IMAGE_RESOLUTION', '768'))
 
10
 
11
  ALLOW_CHANGING_BASE_MODEL = os.getenv('SPACE_ID') != 'hysts/ControlNet-v1-1'
12
  SHOW_DUPLICATE_BUTTON = os.getenv('SHOW_DUPLICATE_BUTTON') == '1'
 
7
  DEFAULT_NUM_IMAGES = min(MAX_NUM_IMAGES,
8
  int(os.getenv('DEFAULT_NUM_IMAGES', '1')))
9
  MAX_IMAGE_RESOLUTION = int(os.getenv('MAX_IMAGE_RESOLUTION', '768'))
10
+ DEFAULT_IMAGE_RESOLUTION = int(os.getenv('DEFAULT_IMAGE_RESOLUTION', '768'))
11
 
12
  ALLOW_CHANGING_BASE_MODEL = os.getenv('SPACE_ID') != 'hysts/ControlNet-v1-1'
13
  SHOW_DUPLICATE_BUTTON = os.getenv('SHOW_DUPLICATE_BUTTON') == '1'