mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-27 09:41:31 +00:00
Update forge_util.py
This commit is contained in:
@@ -28,31 +28,6 @@ def HWC3(x):
|
||||
return y
|
||||
|
||||
|
||||
def compute_cond_mark(cond_or_uncond, sigmas):
|
||||
cond_or_uncond_size = int(sigmas.shape[0])
|
||||
|
||||
cond_mark = []
|
||||
for cx in cond_or_uncond:
|
||||
cond_mark += [cx] * cond_or_uncond_size
|
||||
|
||||
cond_mark = torch.Tensor(cond_mark).to(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))
|
||||
|
||||
Reference in New Issue
Block a user