fffiloni commited on
Commit
02ef9db
·
1 Parent(s): 8363600

Delete gradio_hough2image.py

Browse files
Files changed (1) hide show
  1. gradio_hough2image.py +0 -82
gradio_hough2image.py DELETED
@@ -1,82 +0,0 @@
1
- # This file is adapted from https://github.com/lllyasviel/ControlNet/blob/f4748e3630d8141d7765e2bd9b1e348f47847707/gradio_hough2image.py
2
- # The original license file is LICENSE.ControlNet in this repo.
3
- import gradio as gr
4
-
5
-
6
- def create_demo(process, max_images=12):
7
- with gr.Blocks() as demo:
8
- with gr.Row():
9
- gr.Markdown('## Control Stable Diffusion with Hough Line Maps')
10
- with gr.Row():
11
- with gr.Column():
12
- input_image = gr.Image(source='upload', type='numpy')
13
- prompt = gr.Textbox(label='Prompt')
14
- run_button = gr.Button(label='Run')
15
- with gr.Accordion('Advanced options', open=False):
16
- num_samples = gr.Slider(label='Images',
17
- minimum=1,
18
- maximum=max_images,
19
- value=1,
20
- step=1)
21
- image_resolution = gr.Slider(label='Image Resolution',
22
- minimum=256,
23
- maximum=768,
24
- value=512,
25
- step=256)
26
- detect_resolution = gr.Slider(label='Hough Resolution',
27
- minimum=128,
28
- maximum=1024,
29
- value=512,
30
- step=1)
31
- value_threshold = gr.Slider(
32
- label='Hough value threshold (MLSD)',
33
- minimum=0.01,
34
- maximum=2.0,
35
- value=0.1,
36
- step=0.01)
37
- distance_threshold = gr.Slider(
38
- label='Hough distance threshold (MLSD)',
39
- minimum=0.01,
40
- maximum=20.0,
41
- value=0.1,
42
- step=0.01)
43
- ddim_steps = gr.Slider(label='Steps',
44
- minimum=1,
45
- maximum=100,
46
- value=20,
47
- step=1)
48
- scale = gr.Slider(label='Guidance Scale',
49
- minimum=0.1,
50
- maximum=30.0,
51
- value=9.0,
52
- step=0.1)
53
- seed = gr.Slider(label='Seed',
54
- minimum=-1,
55
- maximum=2147483647,
56
- step=1,
57
- randomize=True,
58
- queue=False)
59
- eta = gr.Number(label='eta (DDIM)', value=0.0)
60
- a_prompt = gr.Textbox(
61
- label='Added Prompt',
62
- value='best quality, extremely detailed')
63
- n_prompt = gr.Textbox(
64
- label='Negative Prompt',
65
- value=
66
- 'longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality'
67
- )
68
- with gr.Column():
69
- result_gallery = gr.Gallery(label='Output',
70
- show_label=False,
71
- elem_id='gallery').style(
72
- grid=2, height='auto')
73
- ips = [
74
- input_image, prompt, a_prompt, n_prompt, num_samples,
75
- image_resolution, detect_resolution, ddim_steps, scale, seed, eta,
76
- value_threshold, distance_threshold
77
- ]
78
- run_button.click(fn=process,
79
- inputs=ips,
80
- outputs=[result_gallery],
81
- api_name='hough')
82
- return demo