Skip to content

Commit

Permalink
xyz_grid: in the legend, remove pathnames from model filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Barron committed Jul 30, 2023
1 parent 68f336b commit 085c903
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/xyz_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from itertools import permutations, chain
import random
import csv
import os.path
from io import StringIO
from PIL import Image
import numpy as np
Expand Down Expand Up @@ -182,6 +183,8 @@ def do_nothing(p, x, xs):
def format_nothing(p, opt, x):
return ""

def format_remove_path(p, opt, x):
return os.path.basename(x)

def str_permutations(x):
"""dummy function for specifying it in AxisOption's type when you want to get a list of permutations"""
Expand Down Expand Up @@ -223,7 +226,7 @@ def __init__(self, *args, **kwargs):
AxisOption("Prompt order", str_permutations, apply_order, format_value=format_value_join_list),
AxisOptionTxt2Img("Sampler", str, apply_sampler, format_value=format_value, confirm=confirm_samplers, choices=lambda: [x.name for x in sd_samplers.samplers]),
AxisOptionImg2Img("Sampler", str, apply_sampler, format_value=format_value, confirm=confirm_samplers, choices=lambda: [x.name for x in sd_samplers.samplers_for_img2img]),
AxisOption("Checkpoint name", str, apply_checkpoint, format_value=format_value, confirm=confirm_checkpoints, cost=1.0, choices=lambda: sorted(sd_models.checkpoints_list, key=str.casefold)),
AxisOption("Checkpoint name", str, apply_checkpoint, format_value=format_remove_path, confirm=confirm_checkpoints, cost=1.0, choices=lambda: sorted(sd_models.checkpoints_list, key=str.casefold)),
AxisOption("Negative Guidance minimum sigma", float, apply_field("s_min_uncond")),
AxisOption("Sigma Churn", float, apply_field("s_churn")),
AxisOption("Sigma min", float, apply_field("s_tmin")),
Expand Down

0 comments on commit 085c903

Please sign in to comment.