fffiloni commited on
Commit
3b24419
·
1 Parent(s): 9c88a60

Delete gradio_canny2image.py

Browse files
Files changed (1) hide show
  1. gradio_canny2image.py +0 -75
gradio_canny2image.py DELETED
@@ -1,75 +0,0 @@
1
- # This file is adapted from https://github.com/lllyasviel/ControlNet/blob/f4748e3630d8141d7765e2bd9b1e348f47847707/gradio_canny2image.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 Canny Edge 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
- low_threshold = gr.Slider(label='Canny low threshold',
27
- minimum=1,
28
- maximum=255,
29
- value=100,
30
- step=1)
31
- high_threshold = gr.Slider(label='Canny high threshold',
32
- minimum=1,
33
- maximum=255,
34
- value=200,
35
- step=1)
36
- ddim_steps = gr.Slider(label='Steps',
37
- minimum=1,
38
- maximum=100,
39
- value=20,
40
- step=1)
41
- scale = gr.Slider(label='Guidance Scale',
42
- minimum=0.1,
43
- maximum=30.0,
44
- value=9.0,
45
- step=0.1)
46
- seed = gr.Slider(label='Seed',
47
- minimum=-1,
48
- maximum=2147483647,
49
- step=1,
50
- randomize=True,
51
- queue=False)
52
- eta = gr.Number(label='eta (DDIM)', value=0.0)
53
- a_prompt = gr.Textbox(
54
- label='Added Prompt',
55
- value='best quality, extremely detailed')
56
- n_prompt = gr.Textbox(
57
- label='Negative Prompt',
58
- value=
59
- 'longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality'
60
- )
61
- with gr.Column():
62
- result_gallery = gr.Gallery(label='Output',
63
- show_label=False,
64
- elem_id='gallery').style(
65
- grid=2, height='auto')
66
- ips = [
67
- input_image, prompt, a_prompt, n_prompt, num_samples,
68
- image_resolution, ddim_steps, scale, seed, eta, low_threshold,
69
- high_threshold
70
- ]
71
- run_button.click(fn=process,
72
- inputs=ips,
73
- outputs=[result_gallery],
74
- api_name='canny')
75
- return demo