Skip to content

Commit

Permalink
Merge pull request AUTOMATIC1111#4 from mattyamonaca/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
mattyamonaca committed Feb 26, 2023
2 parents fb699e0 + a46ec6a commit b6902a1
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 12 deletions.
84 changes: 84 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Bug Report
description: Create a report
title: "[Bug]: "
labels: ["bug-report"]

body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered, and that it hasn't been fixed in a recent build/commit.
options:
- label: I have searched the existing issues and checked the recent builds/commits of both this extension and the webui
required: true
- type: markdown
attributes:
value: |
*Please fill this form with as much information as possible, don't forget to fill "What OS..." and "What browsers" and *provide screenshots if possible**
- type: textarea
id: what-did
attributes:
label: What happened?
description: Tell us what happened in a very clear and simple way
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to reproduce the problem
description: Please provide us with precise step by step information on how to reproduce the bug
value: |
1. Go to ....
2. Press ....
3. ...
validations:
required: true
- type: textarea
id: what-should
attributes:
label: What should have happened?
description: Tell what you think the normal behavior should be
validations:
required: true
- type: textarea
id: commits
attributes:
label: Commit where the problem happens
description: Which commit of the extension are you running on? Please include the commit of both the extension and the webui (Do not write *Latest version/repo/commit*, as this means nothing and will have changed by the time we read your issue. Rather, copy the **Commit** link at the bottom of the UI, or from the cmd/terminal if you can't launch it.)
value: |
webui:\t\t
controlnet:\t
validations:
required: true
- type: dropdown
id: browsers
attributes:
label: What browsers do you use to access the UI ?
multiple: true
options:
- Mozilla Firefox
- Google Chrome
- Brave
- Apple Safari
- Microsoft Edge
- type: textarea
id: cmdargs
attributes:
label: Command Line Arguments
description: Are you using any launching parameters/command line arguments (modified webui-user .bat/.sh) ? If yes, please write them below. Write "No" otherwise.
render: Shell
validations:
required: true
- type: textarea
id: logs
attributes:
label: Console logs
description: Please provide **full** cmd/terminal logs from the moment you started UI to the end of it, after your bug happened. If it's very long, provide a link to pastebin or similar service.
render: Shell
validations:
required: true
- type: textarea
id: misc
attributes:
label: Additional information
description: Please provide us with any relevant additional info or context.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
4 changes: 0 additions & 4 deletions models/control_sd15_depth.pthZone.Identifier

This file was deleted.

4 changes: 0 additions & 4 deletions models/control_sd15_openpose.pthZone.Identifier

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/controlnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,4 +757,4 @@ def on_after_component_callback(self, component, **_kwargs):

img2img_tab_tracker = Img2ImgTabTracker()
script_callbacks.on_ui_settings(on_ui_settings)
script_callbacks.on_after_component(img2img_tab_tracker.on_after_component_callback)
script_callbacks.on_after_component(img2img_tab_tracker.on_after_component_callback)
20 changes: 17 additions & 3 deletions scripts/movie2movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def remove_background(proc):
img = Image.fromarray(nimg).convert("RGB")
return img

def save_gif(path, image_list, name):
def save_gif(path, image_list, name, duration):
tmp_dir = path + "/tmp/"
if os.path.isdir(tmp_dir):
shutil.rmtree(tmp_dir)
Expand All @@ -117,7 +117,7 @@ def save_gif(path, image_list, name):
img = Image.open(path_list[i])
imgs.append(img)

imgs[0].save(path + f"/{name}.gif", save_all=True, append_images=imgs[1:], optimize=False, duration=50, loop=0)
imgs[0].save(path + f"/{name}.gif", save_all=True, append_images=imgs[1:], optimize=False, duration=duration, loop=0)



Expand All @@ -138,6 +138,10 @@ def show(self, is_img2img):
# Most UI components can return a value, such as a boolean for a checkbox.
# The returned values are passed to the run method as parameters.
def ui(self, is_img2img):
def build_sliders(duration):
return [
gr.update(label="Annotator resolution", value=512, minimum=64, maximum=2048, step=1, interactive=True),
]
ctrls_group = ()
max_models = opts.data.get("control_net_max_models_num", 1)

Expand All @@ -148,6 +152,11 @@ def ui(self, is_img2img):
with gr.Tab(f"ControlNet-{i}", open=False):
ctrls_group += (gr.Video(format='mp4', source='upload', elem_id = f"video_{i}"), )

duration = gr.Slider(label=f"Duration", value=50.0, minimum=10.0, maximum=200.0, step=10, interactive=True)
ctrls_group += (duration,)

print(ctrls_group)

return ctrls_group


Expand All @@ -158,8 +167,13 @@ def ui(self, is_img2img):
# to be used in processing. The return value should be a Processed object, which is
# what is returned by the process_images method.
def run(self, p, *args):
print(args)
video_num = opts.data.get("control_net_max_models_num", 1)
video_list = [get_all_frames(video) for video in args[:video_num]]
duration, = args[video_num:]
print(duration)
print("end")

frame_num = get_min_frame_num(video_list)
if frame_num > 0:
output_image_list = []
Expand All @@ -175,7 +189,7 @@ def run(self, p, *args):
img = proc.images[0]
output_image_list.append(img)
copy_p.close()
save_gif(p.outpath_samples, output_image_list, "animation")
save_gif(p.outpath_samples, output_image_list, "animation", duration)
proc.images = [p.outpath_samples + "/animation.gif"]

else:
Expand Down

0 comments on commit b6902a1

Please sign in to comment.