MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / image_grid

Function image_grid

diffusers/examples/controlnet/train_controlnet_sd3.py:67–75  ·  view source on GitHub ↗
(imgs, rows, cols)

Source from the content-addressed store, hash-verified

65
66
67def image_grid(imgs, rows, cols):
68 assert len(imgs) == rows * cols
69
70 w, h = imgs[0].size
71 grid = Image.new("RGB", size=(cols * w, rows * h))
72
73 for i, img in enumerate(imgs):
74 grid.paste(img, box=(i % cols * w, i // cols * h))
75 return grid
76
77
78def log_validation(controlnet, args, accelerator, weight_dtype, step, is_final_validation=False):

Callers 1

save_model_cardFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected