Add option for default save formats (#422)
parent
c6ca8e432b
commit
2573b2b513
|
|
@ -12,7 +12,7 @@ from scripts.animatediff_lora import AnimateDiffLora
|
|||
from scripts.animatediff_mm import mm_animatediff as motion_module
|
||||
from scripts.animatediff_prompt import AnimateDiffPromptSchedule
|
||||
from scripts.animatediff_output import AnimateDiffOutput
|
||||
from scripts.animatediff_ui import AnimateDiffProcess, AnimateDiffUiGroup
|
||||
from scripts.animatediff_ui import AnimateDiffProcess, AnimateDiffUiGroup, supported_save_formats
|
||||
from scripts.animatediff_infotext import update_infotext, infotext_pasted
|
||||
|
||||
script_dir = scripts.basedir()
|
||||
|
|
@ -116,6 +116,16 @@ def on_ui_settings():
|
|||
section=section,
|
||||
),
|
||||
)
|
||||
shared.opts.add_option(
|
||||
"animatediff_default_save_formats",
|
||||
shared.OptionInfo(
|
||||
["GIF", "PNG"],
|
||||
"Default Save Formats",
|
||||
gr.CheckboxGroup,
|
||||
{"choices": supported_save_formats},
|
||||
section=section
|
||||
).needs_restart()
|
||||
)
|
||||
shared.opts.add_option(
|
||||
"animatediff_optimize_gif_palette",
|
||||
shared.OptionInfo(
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from scripts.animatediff_mm import mm_animatediff as motion_module
|
|||
from scripts.animatediff_i2ibatch import animatediff_i2ibatch
|
||||
from scripts.animatediff_lcm import AnimateDiffLCM
|
||||
|
||||
supported_save_formats = ["GIF", "MP4", "WEBP", "WEBM", "PNG", "TXT"]
|
||||
|
||||
class ToolButton(gr.Button, gr.components.FormComponent):
|
||||
"""Small button with single emoji as text, fits inside gradio forms"""
|
||||
|
|
@ -35,7 +36,7 @@ class AnimateDiffProcess:
|
|||
batch_size=16,
|
||||
stride=1,
|
||||
overlap=-1,
|
||||
format=["GIF", "PNG"],
|
||||
format=shared.opts.data.get("animatediff_default_save_formats", ["GIF", "PNG"]),
|
||||
interp='Off',
|
||||
interp_x=10,
|
||||
video_source=None,
|
||||
|
|
@ -187,7 +188,7 @@ class AnimateDiffUiGroup:
|
|||
refresh_model.click(refresh_models, self.params.model, self.params.model)
|
||||
|
||||
self.params.format = gr.CheckboxGroup(
|
||||
choices=["GIF", "MP4", "WEBP", "WEBM", "PNG", "TXT"],
|
||||
choices=supported_save_formats,
|
||||
label="Save format",
|
||||
type="value",
|
||||
elem_id=f"{elemid_prefix}save-format",
|
||||
|
|
|
|||
Loading…
Reference in New Issue