This commit is contained in:
lllyasviel
2024-01-30 20:27:06 -08:00
parent 15e9865f94
commit c2e2d0ea9b
3 changed files with 48 additions and 9 deletions

View File

@@ -39,6 +39,20 @@ def compute_cond_mark(cond_or_uncond, sigmas):
return cond_mark
def compute_cond_indices(cond_or_uncond, sigmas):
cl = int(sigmas.shape[0])
cond_indices = []
uncond_indices = []
for i, cx in enumerate(cond_or_uncond):
if cx == 0:
cond_indices += list(range(i * cl, (i + 1) * cl))
else:
uncond_indices += list(range(i * cl, (i + 1) * cl))
return cond_indices, uncond_indices
def generate_random_filename(extension=".txt"):
timestamp = time.strftime("%Y%m%d-%H%M%S")
random_string = ''.join(random.choices(string.ascii_lowercase + string.digits, k=5))