Skip to content

Commit

Permalink
Merge pull request #12 from ilian6806/develop
Browse files Browse the repository at this point in the history
samples_save option check added
  • Loading branch information
ilian6806 authored May 22, 2023
2 parents 7517400 + f4b6149 commit 0e573c5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 20 deletions.
30 changes: 20 additions & 10 deletions scripts/eyemask/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,22 +209,32 @@ def execute(self, p,
print(e)
save_prompt = orig_image_info

updated_info = self.update_info(initial_info, em_params)

output_images.append(processed.images[0])
p.all_seeds.append(start_seed)
p.all_prompts.append(save_prompt)
p.infotexts.append(updated_info)

if em_include_mask and (n == iterations - 1 or (is_txt2img and em_redraw_original)):
output_images.append(mask)
p.all_seeds.append(start_seed)
p.all_prompts.append(mask_prompt)
p.infotexts.append(updated_info)

shared.state.current_image = processed.images[0]

images.save_image(
processed.images[0],
p.outpath_samples,
"",
start_seed,
save_prompt,
shared.opts.samples_format,
info=self.update_info(initial_info, em_params),
p=p
)
if shared.opts.samples_save:
images.save_image(
processed.images[0],
p.outpath_samples,
"",
start_seed,
save_prompt,
shared.opts.samples_format,
info=updated_info,
p=p
)

devices.torch_gc()
gc.collect()
Expand Down
30 changes: 20 additions & 10 deletions scripts/eyemask/script_embedded.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,22 +190,32 @@ def execute_postprocess(self, p, processed,
print(e)
save_prompt = orig_image_info

updated_info = self.update_info(initial_info, em_params)

processed.images.append(processed_em.images[0])
processed.all_seeds.append(start_seed)
processed.all_prompts.append(save_prompt)
processed.infotexts.append(updated_info)

if em_include_mask and (n == iterations - 1):
processed.images.append(mask)
processed.all_seeds.append(start_seed)
processed.all_prompts.append(mask_prompt)
processed.infotexts.append(updated_info)

shared.state.current_image = processed_em.images[0]

images.save_image(
processed_em.images[0],
p_em.outpath_samples,
"",
start_seed,
save_prompt,
shared.opts.samples_format,
info=self.update_info(initial_info, em_params),
p=p_em
)
if shared.opts.samples_save:
images.save_image(
processed_em.images[0],
p_em.outpath_samples,
"",
start_seed,
save_prompt,
shared.opts.samples_format,
info=updated_info,
p=p_em
)

devices.torch_gc()
gc.collect()

0 comments on commit 0e573c5

Please sign in to comment.