Skip to content

Commit

Permalink
feat: save to agent-scheduler folder
Browse files Browse the repository at this point in the history
  • Loading branch information
bluelovers committed Jun 4, 2024
1 parent 1183c14 commit fcaf117
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions agent_scheduler/task_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,10 @@ def change_output_dir():
key_samples = "outdir_txt2img_samples"
key_grids = "outdir_txt2img_grids"

outdir_path_old_samples = Path(shared_opts_backup.get_backup_value(key_samples))
outdir_path_old_grids = Path(shared_opts_backup.get_backup_value(key_samples))
outdir_path_samples_old = Path(shared_opts_backup.get_backup_value(key_samples))
outdir_path_grids_old = Path(shared_opts_backup.get_backup_value(key_samples))

outdir_path_root = outdir_path_old_samples.joinpath('..', 'agent-scheduler')
outdir_path_root = outdir_path_samples_old.joinpath('..', 'agent-scheduler')

save_to_dirs = False
if save_to_dirs:
Expand All @@ -370,13 +370,13 @@ def change_output_dir():
shared_opts_backup.set_shared_opts_core("directories_filename_pattern",
directories_filename_pattern_new)

outdir_path_samples_new = outdir_path_root.joinpath(outdir_path_old_samples.name)
outdir_path_root.joinpath(outdir_path_old_grids.name)
outdir_path_samples_new = outdir_path_root.joinpath(outdir_path_samples_old.name)
outdir_path_grids_new = outdir_path_root.joinpath(outdir_path_grids_old.name)
else:
outdir_label = time.strftime("%Y-%m-%d_%H-%M-%S") + '_' + str(task_id)

outdir_path_samples_new = outdir_path_root.joinpath(outdir_label, outdir_path_old_samples.name)
outdir_path_grids_new = outdir_path_root.joinpath(outdir_label, outdir_path_old_grids.name)
outdir_path_samples_new = outdir_path_root.joinpath(outdir_label, outdir_path_samples_old.name)
outdir_path_grids_new = outdir_path_root.joinpath(outdir_label, outdir_path_grids_old.name)

shared_opts_backup.set_shared_opts_core(key_samples, str(outdir_path_samples_new))
shared_opts_backup.set_shared_opts_core(key_grids, str(outdir_path_grids_new))
Expand Down

0 comments on commit fcaf117

Please sign in to comment.