Update app.py
Browse files
app.py
CHANGED
|
@@ -89,8 +89,9 @@ with gr.Blocks() as demo:
|
|
| 89 |
print (f'In Callback on {app_state} Done!')
|
| 90 |
|
| 91 |
prompt = prompt + ' masterpiece charcoal pencil art lord of the rings illustration'
|
| 92 |
-
img = pipe(prompt, height=512, width=512, num_inference_steps=inference_steps, callback=callback, callback_steps=
|
| 93 |
app_state['running'] = False
|
|
|
|
| 94 |
return gr.update(value=img.images[0], label='Generated image')
|
| 95 |
|
| 96 |
app_state = gr.State({'img': None,
|
|
@@ -108,12 +109,12 @@ with gr.Blocks() as demo:
|
|
| 108 |
bt_make_image = gr.Button(f"Generate an image (takes about 10-15 minutes on CPU).", visible=False)
|
| 109 |
|
| 110 |
img_description = gr.Markdown('Image generation takes some time'
|
| 111 |
-
' but here you can see
|
| 112 |
-
' Usually there is a significant improvement around step
|
| 113 |
image = gr.Image(label='Illustration for your story', show_label=True)
|
| 114 |
|
| 115 |
inference_steps = gr.Slider(5, 30,
|
| 116 |
-
value=
|
| 117 |
step=1,
|
| 118 |
visible=True,
|
| 119 |
label=f"Num inference steps (more steps makes a better image but takes more time)")
|
|
|
|
| 89 |
print (f'In Callback on {app_state} Done!')
|
| 90 |
|
| 91 |
prompt = prompt + ' masterpiece charcoal pencil art lord of the rings illustration'
|
| 92 |
+
img = pipe(prompt, height=512, width=512, num_inference_steps=inference_steps, callback=callback, callback_steps=3)
|
| 93 |
app_state['running'] = False
|
| 94 |
+
app_state['img'] = None
|
| 95 |
return gr.update(value=img.images[0], label='Generated image')
|
| 96 |
|
| 97 |
app_state = gr.State({'img': None,
|
|
|
|
| 109 |
bt_make_image = gr.Button(f"Generate an image (takes about 10-15 minutes on CPU).", visible=False)
|
| 110 |
|
| 111 |
img_description = gr.Markdown('Image generation takes some time'
|
| 112 |
+
' but here you can see here what is generated from the latent state of the diffuser every few steps.'
|
| 113 |
+
' Usually there is a significant improvement around step 12 that yields much better result')
|
| 114 |
image = gr.Image(label='Illustration for your story', show_label=True)
|
| 115 |
|
| 116 |
inference_steps = gr.Slider(5, 30,
|
| 117 |
+
value=20,
|
| 118 |
step=1,
|
| 119 |
visible=True,
|
| 120 |
label=f"Num inference steps (more steps makes a better image but takes more time)")
|