image_grid

CONFLIIIIICT
pull/10/head
hlky 2022-08-24 15:38:48 +01:00
parent e59b0ef903
commit 10c856011c
No known key found for this signature in database
GPG Key ID: 55A99F1E80D907D5
1 changed files with 5 additions and 2 deletions

View File

@ -237,8 +237,10 @@ device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cp
model = (model if opt.no_half else model.half()).to(device)
def image_grid(imgs, batch_size, round_down=False):
if opt.n_rows > 0:
def image_grid(imgs, batch_size, round_down=False, force_n_rows=None):
if force_n_rows is not None:
rows = force_n_rows
elif opt.n_rows > 0:
rows = opt.n_rows
elif opt.n_rows == 0:
rows = batch_size
@ -257,6 +259,7 @@ def image_grid(imgs, batch_size, round_down=False):
return grid
def draw_prompt_matrix(im, width, height, all_prompts):
def wrap(text, d, font, line_length):
lines = ['']