Add Smithsonian Butterflies and Nouns example datasets

Two permissive ~100-image sets for the Train tab: huggan/smithsonian_butterflies_subset
(CC0, the classic diffusers-docs training set, imported as a subject set with a trigger
prompt since its metadata columns are species names not captions) and m1guelpf/nouns
(CC0, captioned pixel-art avatars via the text column). Both cap at 100 images.
This commit is contained in:
Daniel Han 2026-07-03 06:17:54 +00:00
commit ca2104d481
2 changed files with 54 additions and 1 deletions

View file

@ -200,12 +200,33 @@ def test_list_dataset_examples(client, ds_root):
r = client.get("/api/train/diffusion/dataset-examples")
assert r.status_code == 200, r.text
ids = {e["id"] for e in r.json()["examples"]}
assert {"dreambooth-dog", "tuxemon", "tarot-1920"} <= ids
assert {
"dreambooth-dog",
"tuxemon",
"tarot-1920",
"smithsonian-butterflies",
"pixel-nouns",
} <= ids
dog = next(e for e in r.json()["examples"] if e["id"] == "dreambooth-dog")
assert dog["suggested_trigger"] == "a photo of sks dog"
assert dog["license"]
def test_list_dataset_examples_large_sets(client, ds_root):
# The two ~100-image sets: butterflies is a subject set (trigger, no caption column),
# nouns is a captioned style set (caption column, no trigger). Both cap at 100.
r = client.get("/api/train/diffusion/dataset-examples")
examples = {e["id"]: e for e in r.json()["examples"]}
butterflies = examples["smithsonian-butterflies"]
assert butterflies["image_cap"] == 100
assert butterflies["suggested_trigger"] == "a photo of a sks butterfly"
assert "CC0" in butterflies["license"]
nouns = examples["pixel-nouns"]
assert nouns["image_cap"] == 100
assert nouns["suggested_trigger"] is None
assert nouns["license"] == "cc0-1.0"
class _FakeImageFeature:
# Mimics datasets.Image so _detect_image_column matches by class name.
pass