Skip to content

Commit

Permalink
xyz_grid: add raw_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
wkpark committed Sep 15, 2023
1 parent 102b661 commit dd84423
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/xyz_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ def ui(self, is_img2img):
with gr.Column():
include_lone_images = gr.Checkbox(label='Include Sub Images', value=False, elem_id=self.elem_id("include_lone_images"))
include_sub_grids = gr.Checkbox(label='Include Sub Grids', value=False, elem_id=self.elem_id("include_sub_grids"))
raw_mode = gr.Checkbox(label='Use raw text lines', value=False, elem_id=self.elem_id("raw_mode"))
with gr.Column():
margin_size = gr.Slider(label="Grid margins (px)", minimum=0, maximum=500, value=0, step=2, elem_id=self.elem_id("margin_size"))
with gr.Column():
Expand Down Expand Up @@ -521,9 +522,9 @@ def get_dropdown_update_from_params(axis, params):
(z_values_dropdown, lambda params: get_dropdown_update_from_params("Z", params)),
)

return [x_type, x_values, x_values_dropdown, y_type, y_values, y_values_dropdown, z_type, z_values, z_values_dropdown, draw_legend, include_lone_images, include_sub_grids, no_fixed_seeds, margin_size, csv_mode]
return [x_type, x_values, x_values_dropdown, y_type, y_values, y_values_dropdown, z_type, z_values, z_values_dropdown, draw_legend, include_lone_images, include_sub_grids, no_fixed_seeds, margin_size, csv_mode, raw_mode]

def run(self, p, x_type, x_values, x_values_dropdown, y_type, y_values, y_values_dropdown, z_type, z_values, z_values_dropdown, draw_legend, include_lone_images, include_sub_grids, no_fixed_seeds, margin_size, csv_mode):
def run(self, p, x_type, x_values, x_values_dropdown, y_type, y_values, y_values_dropdown, z_type, z_values, z_values_dropdown, draw_legend, include_lone_images, include_sub_grids, no_fixed_seeds, margin_size, csv_mode, raw_mode):
if not no_fixed_seeds:
modules.processing.fix_seed(p)

Expand All @@ -536,6 +537,8 @@ def process_axis(opt, vals, vals_dropdown):

if opt.choices is not None and not csv_mode:
valslist = vals_dropdown
elif raw_mode and vals.strip().find("\n") != -1:
valslist = vals.strip().split("\n")
else:
valslist = csv_string_to_list_strip(vals)

Expand Down

0 comments on commit dd84423

Please sign in to comment.