Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
🔄 Synced local 'scripts/webui.py' with remote 'webui.py'
Browse files Browse the repository at this point in the history
  • Loading branch information
hlky authored and hlky committed Sep 1, 2022
1 parent 70bd4a4 commit fbf814e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions scripts/webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,10 @@ def check_prompt_length(prompt, comments):

def save_sample(image, sample_path_i, filename, jpg_sample, prompts, seeds, width, height, steps, cfg_scale,
normalize_prompt_weights, use_GFPGAN, write_info_files, prompt_matrix, init_img, uses_loopback, uses_random_seed_loopback, skip_save,
skip_grid, sort_samples, sampler_name, ddim_eta, n_iter, batch_size, i, denoising_strength, resize_mode):
skip_grid, sort_samples, sampler_name, ddim_eta, n_iter, batch_size, i, denoising_strength, resize_mode, skip_metadata):
filename_i = os.path.join(sample_path_i, filename)
if not jpg_sample:
if opt.save_metadata:
if opt.save_metadata and not skip_metadata:
metadata = PngInfo()
metadata.add_text("SD:prompt", prompts[i])
metadata.add_text("SD:seed", str(seeds[i]))
Expand Down Expand Up @@ -895,7 +895,7 @@ def process_images(
gfpgan_filename = original_filename + '-gfpgan'
save_sample(gfpgan_image, sample_path_i, gfpgan_filename, jpg_sample, prompts, seeds, width, height, steps, cfg_scale,
normalize_prompt_weights, use_GFPGAN, write_info_files, prompt_matrix, init_img, uses_loopback, uses_random_seed_loopback, skip_save,
skip_grid, sort_samples, sampler_name, ddim_eta, n_iter, batch_size, i, denoising_strength, resize_mode)
skip_grid, sort_samples, sampler_name, ddim_eta, n_iter, batch_size, i, denoising_strength, resize_mode, False)
#output_images.append(gfpgan_image) #287
#if simple_templating:
# grid_captions.append( captions[i] + "\ngfpgan" )
Expand All @@ -911,7 +911,7 @@ def process_images(
esrgan_image = Image.fromarray(esrgan_sample)
save_sample(esrgan_image, sample_path_i, esrgan_filename, jpg_sample, prompts, seeds, width, height, steps, cfg_scale,
normalize_prompt_weights, use_GFPGAN, write_info_files, prompt_matrix, init_img, uses_loopback, uses_random_seed_loopback, skip_save,
skip_grid, sort_samples, sampler_name, ddim_eta, n_iter, batch_size, i, denoising_strength, resize_mode)
skip_grid, sort_samples, sampler_name, ddim_eta, n_iter, batch_size, i, denoising_strength, resize_mode, False)
#output_images.append(esrgan_image) #287
#if simple_templating:
# grid_captions.append( captions[i] + "\nesrgan" )
Expand All @@ -929,7 +929,7 @@ def process_images(
gfpgan_esrgan_image = Image.fromarray(gfpgan_esrgan_sample)
save_sample(gfpgan_esrgan_image, sample_path_i, gfpgan_esrgan_filename, jpg_sample, prompts, seeds, width, height, steps, cfg_scale,
normalize_prompt_weights, use_GFPGAN, write_info_files, prompt_matrix, init_img, uses_loopback, uses_random_seed_loopback, skip_save,
skip_grid, sort_samples, sampler_name, ddim_eta, n_iter, batch_size, i, denoising_strength, resize_mode)
skip_grid, sort_samples, sampler_name, ddim_eta, n_iter, batch_size, i, denoising_strength, resize_mode, False)
#output_images.append(gfpgan_esrgan_image) #287
#if simple_templating:
# grid_captions.append( captions[i] + "\ngfpgan_esrgan" )
Expand All @@ -940,7 +940,7 @@ def process_images(
if not skip_save:
save_sample(image, sample_path_i, filename, jpg_sample, prompts, seeds, width, height, steps, cfg_scale,
normalize_prompt_weights, use_GFPGAN, write_info_files, prompt_matrix, init_img, uses_loopback, uses_random_seed_loopback, skip_save,
skip_grid, sort_samples, sampler_name, ddim_eta, n_iter, batch_size, i, denoising_strength, resize_mode)
skip_grid, sort_samples, sampler_name, ddim_eta, n_iter, batch_size, i, denoising_strength, resize_mode, False)
if add_original_image or not simple_templating:
output_images.append(image)
if simple_templating:
Expand Down Expand Up @@ -1707,7 +1707,7 @@ def processLDSR(image):

if 1 not in imgproc_toggles:
output.append(image)
save_sample(image, outpathDir, outFilename, False, None, None, None, None, None, None, None, None, None, None, None, None, None, False, None, None, None, None, None, None, None, None, None)
save_sample(image, outpathDir, outFilename, False, None, None, None, None, None, None, None, None, None, None, None, None, None, False, None, None, None, None, None, None, None, None, None, True)

if 1 in imgproc_toggles:
if imgproc_upscale_toggles == 0:
Expand All @@ -1720,7 +1720,7 @@ def processLDSR(image):
batchNumber = get_next_sequence_number(outpathDir)
outFilename = str(batchNumber)+'-'+'result'
output.append(image)
save_sample(image, outpathDir, outFilename, False, None, None, None, None, None, None, None, None, None, None, None, None, None, False, None, None, None, None, None, None, None, None, None)
save_sample(image, outpathDir, outFilename, False, None, None, None, None, None, None, None, None, None, None, None, None, None, False, None, None, None, None, None, None, None, None, None, True)

elif imgproc_upscale_toggles == 1:

Expand All @@ -1732,7 +1732,7 @@ def processLDSR(image):
batchNumber = get_next_sequence_number(outpathDir)
outFilename = str(batchNumber)+'-'+'result'
output.append(image)
save_sample(image, outpathDir, outFilename, False, None, None, None, None, None, None, None, None, None, None, None, None, None, False, None, None, None, None, None, None, None, None, None)
save_sample(image, outpathDir, outFilename, False, None, None, None, None, None, None, None, None, None, None, None, None, None, False, None, None, None, None, None, None, None, None, None, True)

elif imgproc_upscale_toggles == 2:

Expand All @@ -1744,7 +1744,7 @@ def processLDSR(image):
batchNumber = get_next_sequence_number(outpathDir)
outFilename = str(batchNumber)+'-'+'result'
output.append(image)
save_sample(image, outpathDir, outFilename, False, None, None, None, None, None, None, None, None, None, None, None, None, None, False, None, None, None, None, None, None, None, None, None)
save_sample(image, outpathDir, outFilename, False, None, None, None, None, None, None, None, None, None, None, None, None, None, False, None, None, None, None, None, None, None, None, None, True)

elif imgproc_upscale_toggles == 3:

Expand All @@ -1760,7 +1760,7 @@ def processLDSR(image):
outFilename = str(batchNumber)+'-'+'result'
output.append(image)

save_sample(image, outpathDir, outFilename, False, None, None, None, None, None, None, None, None, None, None, None, None, None, False, None, None, None, None, None, None, None, None, None)
save_sample(image, outpathDir, outFilename, None, None, None, None, None, None, None, None, None, None, None, None, None, None, False, None, None, None, None, None, None, None, None, None, True)

#LDSR is always unloaded to avoid memory issues
ModelLoader(['LDSR'],False,True)
Expand Down

0 comments on commit fbf814e

Please sign in to comment.