Upload test_grid.py with huggingface_hub
Browse files- test_grid.py +13 -3
test_grid.py
CHANGED
|
@@ -25,6 +25,12 @@ PROMPT_PRESETS = {
|
|
| 25 |
"soft fur shading, warm colors, subtle highlights, thin brown outline, "
|
| 26 |
"cute face, dot eyes with highlights, pink blush, white background"
|
| 27 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
}
|
| 29 |
|
| 30 |
|
|
@@ -78,6 +84,7 @@ def main():
|
|
| 78 |
parser.add_argument("--prompt-presets", default="default,soft,sprite")
|
| 79 |
parser.add_argument("--seed", type=int, default=42)
|
| 80 |
parser.add_argument("--limit", type=int, default=0, help="Limit number of input images. 0 means all.")
|
|
|
|
| 81 |
args = parser.parse_args()
|
| 82 |
|
| 83 |
images = collect_images(args.input)
|
|
@@ -130,13 +137,16 @@ def main():
|
|
| 130 |
f"_st{strength:.2f}_cn{controlnet_scale:.2f}_g{guidance_scale:.1f}.png"
|
| 131 |
)
|
| 132 |
output_path = image_output_dir / filename
|
| 133 |
-
|
|
|
|
|
|
|
| 134 |
|
| 135 |
title = f"{prompt_key}\nst={strength:.2f} cn={controlnet_scale:.2f} g={guidance_scale:.1f}"
|
| 136 |
grid_items.append((title, result["image"]))
|
| 137 |
-
print(f"saved {output_path}")
|
| 138 |
|
| 139 |
-
|
|
|
|
|
|
|
| 140 |
|
| 141 |
print(f"done: {output_dir}")
|
| 142 |
|
|
|
|
| 25 |
"soft fur shading, warm colors, subtle highlights, thin brown outline, "
|
| 26 |
"cute face, dot eyes with highlights, pink blush, white background"
|
| 27 |
),
|
| 28 |
+
"reference": (
|
| 29 |
+
"cute plush toy, high resolution pixel art character, large visible pixels, "
|
| 30 |
+
"rounded chibi body, front-facing full body, warm soft shading, "
|
| 31 |
+
"brown pixel outline, glossy dot eyes, tiny nose, small smile, "
|
| 32 |
+
"pink cheek blush, clean white background"
|
| 33 |
+
),
|
| 34 |
}
|
| 35 |
|
| 36 |
|
|
|
|
| 84 |
parser.add_argument("--prompt-presets", default="default,soft,sprite")
|
| 85 |
parser.add_argument("--seed", type=int, default=42)
|
| 86 |
parser.add_argument("--limit", type=int, default=0, help="Limit number of input images. 0 means all.")
|
| 87 |
+
parser.add_argument("--save-individual", action="store_true", help="Also save every generated image.")
|
| 88 |
args = parser.parse_args()
|
| 89 |
|
| 90 |
images = collect_images(args.input)
|
|
|
|
| 137 |
f"_st{strength:.2f}_cn{controlnet_scale:.2f}_g{guidance_scale:.1f}.png"
|
| 138 |
)
|
| 139 |
output_path = image_output_dir / filename
|
| 140 |
+
if args.save_individual:
|
| 141 |
+
result["image"].save(output_path)
|
| 142 |
+
print(f"saved {output_path}")
|
| 143 |
|
| 144 |
title = f"{prompt_key}\nst={strength:.2f} cn={controlnet_scale:.2f} g={guidance_scale:.1f}"
|
| 145 |
grid_items.append((title, result["image"]))
|
|
|
|
| 146 |
|
| 147 |
+
grid_path = image_output_dir / f"{stem}_grid.png"
|
| 148 |
+
save_grid(grid_items, grid_path, columns=4)
|
| 149 |
+
print(f"saved grid {grid_path}")
|
| 150 |
|
| 151 |
print(f"done: {output_dir}")
|
| 152 |
|