mirror of
https://github.com/Extraltodeus/test_my_prompt.git
synced 2026-03-13 17:29:54 +00:00
Update test_my_prompt_custom_script.py
This commit is contained in:
@@ -14,10 +14,11 @@ class Script(scripts.Script):
|
||||
neg_pos = gr.Dropdown(label="Test negative or positive", choices=["Positive","Negative"], value="Positive")
|
||||
skip_x_first = gr.Slider(minimum=0, maximum=32, step=1, label='Skip X first words', value=0)
|
||||
separator = gr.Textbox(label="Separator used", lines=1, value=", ")
|
||||
always_grid = gr.Checkbox(label='Always generate a grid', value=True)
|
||||
font_size = gr.Slider(minimum=12, maximum=64, step=1, label='Font size', value=32)
|
||||
return [neg_pos,skip_x_first,separator,font_size]
|
||||
return [neg_pos,skip_x_first,separator,always_grid,font_size]
|
||||
|
||||
def run(self, p,neg_pos,skip_x_first,separator,font_size):
|
||||
def run(self, p,neg_pos,skip_x_first,separator,always_grid,font_size):
|
||||
def write_on_image(img, msg):
|
||||
ix,iy = img.size
|
||||
draw = ImageDraw.Draw(img)
|
||||
@@ -74,7 +75,7 @@ class Script(scripts.Script):
|
||||
images.save_image(proc.images[0], p.outpath_samples, "", proc.seed, proc.prompt, opts.samples_format, info= proc.info, p=p)
|
||||
|
||||
unwanted_grid_because_of_img_count = len(output_images) < 2 and opts.grid_only_if_multiple
|
||||
if (opts.return_grid or opts.grid_save) and not p.do_not_save_grid and not unwanted_grid_because_of_img_count:
|
||||
if ((opts.return_grid or opts.grid_save) and not p.do_not_save_grid and not unwanted_grid_because_of_img_count) or always_grid:
|
||||
grid = images.image_grid(output_images)
|
||||
if opts.grid_save:
|
||||
images.save_image(grid, p.outpath_grids, "grid", initial_seed, initial_prompt, opts.grid_format, info=proc.info, short_filename=not opts.grid_extended_filename, p=p, grid=True)
|
||||
|
||||
Reference in New Issue
Block a user