Skip to content

Commit

Permalink
Merge branch 'automatic1111-webui' into animatediff
Browse files Browse the repository at this point in the history
  • Loading branch information
kabachuha committed Nov 12, 2023
2 parents d698d75 + f0fb9d7 commit 224b51c
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ body:
id: logs
attributes:
label: Console logs
description: Now, it is the most important part which most users fail for the first time! Please provide the **full** cmd/terminal logs from the moment you started the webui (i.e. clicked the launch file or started it from cmd) to the part when your bug happened.
description: Now, it is the most important part which most users fail for the first time! Please provide the **full** cmd/terminal logs from the moment you started the webui (i.e. clicked the launch file or started it from cmd) to the part when your bug happened. If you have an **excellent reason** for not being able to include the log, include the string 'I have a good reason for not including the log' and explain why. Try to include at least the webui commit hash, deforum extension commit hash, pyton version and model you are working with.
render: Shell
validations:
required: true
Expand Down
4 changes: 3 additions & 1 deletion .github/scripts/issue_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@

# Define the keywords to search for in the issue
keywords = ['Python', 'Commit hash', 'Launching Web UI with arguments', 'Model loaded', 'deforum']
excuse = 'I have a good reason for not including the log'

# Check if ALL of the keywords are present in the issue
def check_keywords(issue_body, keywords):
for keyword in keywords:
if not re.search(r'\b' + re.escape(keyword) + r'\b', issue_body, re.IGNORECASE):
return False
if not re.search(re.escape(excuse), issue_body, re.IGNORECASE):
return False
return True

# Check if the issue title has at least a specified number of words
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ git clone https://github.com/deforum-art/sd-webui-deforum extensions/deforum

Or download this repository, locate the `extensions` folder within your WebUI installation, create a folder named `deforum` and put the contents of the downloaded directory inside of it. Then restart WebUI.

Or launch A1111, navigate to the Extensions tab, choose Available, find deforum in the list of available extensions and install it. Restart A1111 once the extension has been installed.
3. Open the webui, find the Deforum tab at the top of the page.

4. Enter the animation settings. Refer to [this general guide](https://docs.google.com/document/d/1pEobUknMFMkn8F5TMsv8qRzamXX_75BShMMXV8IFslI/edit) and [this guide to math keyframing functions in Deforum](https://docs.google.com/document/d/1pfW1PwbDIuW0cv-dnuyYj1UzPqe23BlSLTJsqazffXM/edit?usp=sharing). However, **in this version prompt weights less than zero don't just like in original Deforum!** Split the positive and the negative prompt in the json section using --neg argument like this "apple:\`where(cos(t)>=0, cos(t), 0)\`, snow --neg strawberry:\`where(cos(t)<0, -cos(t), 0)\`"
Expand Down
3 changes: 2 additions & 1 deletion scripts/deforum_helpers/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,12 +802,13 @@ def DeforumArgs():
"info": ""
},
"strength": {
"label": "strength",
"label": "Strength",
"type": "slider",
"minimum": 0,
"maximum": 1,
"step": 0.01,
"value": 0.8,
"info": "the inverse of denoise; lower values alter the init image more (high denoise); higher values alter it less (low denoise)"
},
"strength_0_no_init": {
"label": "Strength 0 no init",
Expand Down
40 changes: 34 additions & 6 deletions scripts/deforum_helpers/ui_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Contact the authors: https://deforum.github.io/

import gradio as gr
from modules.ui_components import FormRow, FormColumn
from modules.ui_components import FormRow, FormColumn, ToolButton
from .defaults import get_gradio_html, DeforumAnimPrompts
from .video_audio_utilities import direct_stitch_vid_from_frames
from .gradio_funcs import upload_vid_to_interpolate, upload_pics_to_interpolate, ncnn_upload_vid_to_upscale, upload_vid_to_depth
Expand Down Expand Up @@ -78,6 +78,7 @@ def get_tab_run(d, da):
return {k: v for k, v in {**locals(), **vars()}.items()}

def get_tab_keyframes(d, da, dloopArgs):
components = {}
with gr.TabItem('Keyframes'): # TODO make a some sort of the original dictionary parsing
with FormRow():
with FormColumn(scale=2):
Expand Down Expand Up @@ -154,11 +155,25 @@ def get_tab_keyframes(d, da, dloopArgs):
with FormRow():
checkpoint_schedule = create_gr_elem(da.checkpoint_schedule)
# MOTION INNER TAB
refresh_symbol = '\U0001f504' # 🔄
with gr.Tabs(elem_id='motion_noise_etc'):
with gr.TabItem('Motion') as motion_tab:
with FormColumn() as only_2d_motion_column:
with FormRow():
with FormRow(variant="compact"):
zoom = create_gr_elem(da.zoom)
reset_zoom_button = ToolButton(elem_id='reset_zoom_btn', value=refresh_symbol, tooltip="Reset zoom to static.")
components['zoom'] = zoom

def reset_zoom_field():
return {
zoom: gr.update(value='0:(1)', visible=True)
}

reset_zoom_button.click(
fn=reset_zoom_field,
inputs=[],
outputs=[zoom]
)
with FormRow():
angle = create_gr_elem(da.angle)
with FormRow():
Expand All @@ -173,6 +188,19 @@ def get_tab_keyframes(d, da, dloopArgs):
with FormColumn(visible=False) as only_3d_motion_column:
with FormRow():
translation_z = create_gr_elem(da.translation_z)
reset_tr_z_button = ToolButton(elem_id='reset_tr_z_btn', value=refresh_symbol, tooltip="Reset translation Z to static.")
components['tr_z'] = translation_z

def reset_tr_z_field():
return {
translation_z: gr.update(value='0:(0)', visible=True)
}

reset_tr_z_button.click(
fn=reset_tr_z_field,
inputs=[],
outputs=[translation_z]
)
with FormRow():
rotation_3d_x = create_gr_elem(da.rotation_3d_x)
with FormRow():
Expand All @@ -190,6 +218,7 @@ def get_tab_keyframes(d, da, dloopArgs):
perspective_flip_gamma = create_gr_elem(da.perspective_flip_gamma)
with FormRow(visible=False) as per_f_f_row:
perspective_flip_fv = create_gr_elem(da.perspective_flip_fv)

# NOISE INNER TAB
with gr.TabItem('Noise'):
with FormColumn() as noise_tab_column:
Expand Down Expand Up @@ -347,13 +376,12 @@ def get_tab_init(d, da, dp):
mask_contrast_adjust = create_gr_elem(d.mask_contrast_adjust)
with FormColumn(min_width=250):
mask_brightness_adjust = create_gr_elem(d.mask_brightness_adjust)
# PARSEQ ACCORD
with gr.Accordion('Parseq', open=False):
gr.HTML(value=get_gradio_html('parseq'))
# PARSEQ INNER-TAB
with gr.Tab('Parseq'):
with FormRow():
parseq_manifest = create_gr_elem(dp.parseq_manifest)
with FormRow():
parseq_non_schedule_overrides = create_gr_elem(dp.parseq_non_schedule_overrides)
parseq_non_schedule_overrides = create_gr_elem(dp.parseq_non_schedule_overrides)
with FormRow():
parseq_use_deltas = create_gr_elem(dp.parseq_use_deltas)
return {k: v for k, v in {**locals(), **vars()}.items()}
Expand Down
9 changes: 8 additions & 1 deletion scripts/deforum_helpers/video_audio_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,21 @@ def is_vid_path_valid(video_path):
# vid path is actually a URL, check it
if video_path.startswith('http://') or video_path.startswith('https://'):
response = requests.head(video_path, allow_redirects=True)
extension = video_path.rsplit('?', 1)[0] # remove query string before checking file format extension.
content_disposition = response.headers.get('Content-Disposition')
if content_disposition:
# Attempt to extract the filename from the Content-Disposition header
match = re.search(r'filename="?(?P<filename>[^"]+)"?', content_disposition)
if match:
extension = match.group('filename').rsplit('.', 1)[-1].lower()
if response.status_code == 404:
raise ConnectionError(f"Video URL {video_path} is not valid. Response status code: {response.status_code}")
elif response.status_code == 302:
response = requests.head(response.headers['location'], allow_redirects=True)
if response.status_code != 200:
raise ConnectionError(f"Video URL {video_path} is not valid. Response status code: {response.status_code}")
if extension not in file_formats:
raise ValueError(f"Video file {video_path} has format '{extension}', which not supported. Supported formats are: {file_formats}")
raise ValueError(f"Video file {video_path} has format '{extension}', which is not supported. Supported formats are: {file_formats}")
else:
video_path = os.path.realpath(video_path)
if not os.path.exists(video_path):
Expand Down

0 comments on commit 224b51c

Please sign in to comment.