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

Function image_grid

diffusers/examples/controlnet/train_controlnet.py:68–76  ·  view source on GitHub ↗
(imgs, rows, cols)

Source from the content-addressed store, hash-verified

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

Callers 1

save_model_cardFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected