Skip to content
Python

Batch 1 examples carry their inputs, so "Load this example" fills the form

neuregex695905f9bdab
diff --git a/lab/publish.py b/lab/publish.py
index 4e6aeee..45359fa 100644
--- a/lab/publish.py
+++ b/lab/publish.py
@@ -197,6 +197,15 @@ def main(argv: list[str] | None = None) -> int:
inputs.append({"id": input_id, "label": labels.get(input_id, {}).get("label", input_id),
"type": w.get("type"), "src": src, "full": playable, "from_case": source["id"]})
continue
+ if isinstance(raw, str) and raw.startswith("asset:") and (ROOT / "lab" / "assets" / raw[len("asset:"):]).exists():
+ # a file kept in lab/assets (inpaint's painted mask): copied as it is, so "Load this example" fills it in too
+ asset = ROOT / "lab" / "assets" / raw[len("asset:"):]
+ name = f"input-{input_id}-full{asset.suffix.lower()}"
+ shutil.copy(asset, dest / name)
+ rel = f"examples/{app_id}/{name}"
+ inputs.append({"id": input_id, "label": labels.get(input_id, {}).get("label", input_id),
+ "type": labels.get(input_id, {}).get("type"), "src": rel, "full": rel, "from": raw})
+ continue
inputs.append({"id": input_id, "label": labels.get(input_id, {}).get("label", input_id),
"type": labels.get(input_id, {}).get("type"), "src": None, "full": None, "from": raw})
diff --git a/web/examples/character-3/input-photo1-full.jpg b/web/examples/character-3/input-photo1-full.jpg
new file mode 100644
index 0000000..4616bce
Binary files /dev/null and b/web/examples/character-3/input-photo1-full.jpg differ
diff --git a/web/examples/character-3/input-photo1.jpg b/web/examples/character-3/input-photo1.jpg
new file mode 100644
index 0000000..d5245c5
Binary files /dev/null and b/web/examples/character-3/input-photo1.jpg differ
diff --git a/web/examples/character-3/input-photo2-full.jpg b/web/examples/character-3/input-photo2-full.jpg
new file mode 100644
index 0000000..aa3dcbf
Binary files /dev/null and b/web/examples/character-3/input-photo2-full.jpg differ
diff --git a/web/examples/character-3/input-photo2.jpg b/web/examples/character-3/input-photo2.jpg
new file mode 100644
index 0000000..7a48a6a
Binary files /dev/null and b/web/examples/character-3/input-photo2.jpg differ
diff --git a/web/examples/character-3/input-photo3-full.jpg b/web/examples/character-3/input-photo3-full.jpg
new file mode 100644
index 0000000..c126430
Binary files /dev/null and b/web/examples/character-3/input-photo3-full.jpg differ
diff --git a/web/examples/character-3/input-photo3.jpg b/web/examples/character-3/input-photo3.jpg
new file mode 100644
index 0000000..451d6d6
Binary files /dev/null and b/web/examples/character-3/input-photo3.jpg differ
diff --git a/web/examples/index.json b/web/examples/index.json
index 89f8faf..3ceae1f 100644
--- a/web/examples/index.json
+++ b/web/examples/index.json
@@ -4413,25 +4413,25 @@
"id": "photo1",
"label": "Photo 1",
"type": "image",
- "src": null,
- "full": null,
- "from": "@case:ref-face-a"
+ "src": "examples/character-3/input-photo1.jpg",
+ "full": "examples/character-3/input-photo1-full.jpg",
+ "from_case": "ref-face-a"
},
{
"id": "photo2",
"label": "Photo 2",
"type": "image",
- "src": null,
- "full": null,
- "from": "@case:ref-face-a-side"
+ "src": "examples/character-3/input-photo2.jpg",
+ "full": "examples/character-3/input-photo2-full.jpg",
+ "from_case": "ref-face-a-side"
},
{
"id": "photo3",
"label": "Photo 3",
"type": "image",
- "src": null,
- "full": null,
- "from": "@case:ref-face-a-outdoor"
+ "src": "examples/character-3/input-photo3.jpg",
+ "full": "examples/character-3/input-photo3-full.jpg",
+ "from_case": "ref-face-a-outdoor"
}
],
"values": {
@@ -4457,16 +4457,16 @@
"id": "image",
"label": "Photo",
"type": "image",
- "src": null,
- "full": null,
- "from": "@case:ref-face-a"
+ "src": "examples/inpaint/input-image.jpg",
+ "full": "examples/inpaint/input-image-full.jpg",
+ "from_case": "ref-face-a"
},
{
"id": "mask",
"label": "Area to change",
"type": "image",
- "src": null,
- "full": null,
+ "src": "examples/inpaint/input-mask-full.png",
+ "full": "examples/inpaint/input-mask-full.png",
"from": "asset:mask-face-a-jacket.png"
}
],
@@ -4491,9 +4491,9 @@
"id": "photo",
"label": "Your photo",
"type": "image",
- "src": null,
- "full": null,
- "from": "@case:ref-face-a"
+ "src": "examples/photodump/input-photo.jpg",
+ "full": "examples/photodump/input-photo-full.jpg",
+ "from_case": "ref-face-a"
}
],
"values": {
@@ -4518,25 +4518,25 @@
"id": "style1",
"label": "Reference 1",
"type": "image",
- "src": null,
- "full": null,
- "from": "@case:ref-mood-diner"
+ "src": "examples/moodboard/input-style1.jpg",
+ "full": "examples/moodboard/input-style1-full.jpg",
+ "from_case": "ref-mood-diner"
},
{
"id": "style2",
"label": "Reference 2",
"type": "image",
- "src": null,
- "full": null,
- "from": "@case:ref-mood-wagon"
+ "src": "examples/moodboard/input-style2.jpg",
+ "full": "examples/moodboard/input-style2-full.jpg",
+ "from_case": "ref-mood-wagon"
},
{
"id": "style3",
"label": "Reference 3",
"type": "image",
- "src": null,
- "full": null,
- "from": "@case:ref-mood-coffee"
+ "src": "examples/moodboard/input-style3.jpg",
+ "full": "examples/moodboard/input-style3-full.jpg",
+ "from_case": "ref-mood-coffee"
}
],
"values": {
@@ -4552,5 +4552,5 @@
"run": "20261026-003153-l40s"
}
},
- "updated_from": "20261026-003153-l40s"
+ "updated_from": "20261026-003753-l40s"
}
diff --git a/web/examples/inpaint/input-image-full.jpg b/web/examples/inpaint/input-image-full.jpg
new file mode 100644
index 0000000..4616bce
Binary files /dev/null and b/web/examples/inpaint/input-image-full.jpg differ
diff --git a/web/examples/inpaint/input-image.jpg b/web/examples/inpaint/input-image.jpg
new file mode 100644
index 0000000..d5245c5
Binary files /dev/null and b/web/examples/inpaint/input-image.jpg differ
diff --git a/web/examples/inpaint/input-mask-full.png b/web/examples/inpaint/input-mask-full.png
new file mode 100644
index 0000000..16ffdb0
Binary files /dev/null and b/web/examples/inpaint/input-mask-full.png differ
diff --git a/web/examples/moodboard/input-style1-full.jpg b/web/examples/moodboard/input-style1-full.jpg
new file mode 100644
index 0000000..294a139
Binary files /dev/null and b/web/examples/moodboard/input-style1-full.jpg differ
diff --git a/web/examples/moodboard/input-style1.jpg b/web/examples/moodboard/input-style1.jpg
new file mode 100644
index 0000000..a1ea353
Binary files /dev/null and b/web/examples/moodboard/input-style1.jpg differ
diff --git a/web/examples/moodboard/input-style2-full.jpg b/web/examples/moodboard/input-style2-full.jpg
new file mode 100644
index 0000000..4cffbec
Binary files /dev/null and b/web/examples/moodboard/input-style2-full.jpg differ
diff --git a/web/examples/moodboard/input-style2.jpg b/web/examples/moodboard/input-style2.jpg
new file mode 100644
index 0000000..5758620
Binary files /dev/null and b/web/examples/moodboard/input-style2.jpg differ
diff --git a/web/examples/moodboard/input-style3-full.jpg b/web/examples/moodboard/input-style3-full.jpg
new file mode 100644
index 0000000..444564e
Binary files /dev/null and b/web/examples/moodboard/input-style3-full.jpg differ
diff --git a/web/examples/moodboard/input-style3.jpg b/web/examples/moodboard/input-style3.jpg
new file mode 100644
index 0000000..46aa06c
Binary files /dev/null and b/web/examples/moodboard/input-style3.jpg differ
diff --git a/web/examples/photodump/input-photo-full.jpg b/web/examples/photodump/input-photo-full.jpg
new file mode 100644
index 0000000..4616bce
Binary files /dev/null and b/web/examples/photodump/input-photo-full.jpg differ
diff --git a/web/examples/photodump/input-photo.jpg b/web/examples/photodump/input-photo.jpg
new file mode 100644
index 0000000..d5245c5
Binary files /dev/null and b/web/examples/photodump/input-photo.jpg differ