Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix restore option #167

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/pytti/workhorse.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,15 @@ def _main(cfg: DictConfig):
# @markdown check `restore` to restore from a previous run
restore = params.get("restore") or False # @param{type:"boolean"}
# @markdown check `reencode` if you are restoring with a modified image or modified image settings
reencode = False # @param{type:"boolean"}
reencode = params.get("reencode") or False # @param{type:"boolean"}
# @markdown which run to restore
restore_run = latest # @param{type:"raw"}

# NB: `backup/` dir probably not working at present
if restore and restore_run == latest:
_, restore_run = get_last_file(
f"backup/{params.file_namespace}",
f"^(?P<pre>{re.escape(params.file_namespace)}\\(?)(?P<index>\\d*)(?P<post>\\)?_\\d+\\.bak)$",
f"images_out/{params.file_namespace}",
f"^(?P<pre>{re.escape(params.file_namespace)}\\(?)(?P<index>\\d*)(?P<post>\\)?_\\d+\\.png)$",
)

# I feel like there's probably no reason this is defined inside of _main()
Expand Down