Spaces:
Running on Zero
Running on Zero
Deploy Karate Wiener (kimodo kata maker)
Browse files- .gitattributes +9 -0
- app.py +9 -3
- comic_klein_out/final_bubbles_1234.png +3 -0
- comic_klein_out/final_bubbles_7.png +3 -0
- comic_klein_out/final_notext_1234.png +3 -0
- comic_klein_out/final_notext_7.png +3 -0
- comic_klein_out/raw_bubbles_1234.png +3 -0
- comic_klein_out/raw_bubbles_7.png +3 -0
- comic_klein_out/raw_notext_1234.png +3 -0
- comic_klein_out/raw_notext_7.png +3 -0
- comic_klein_test.png +3 -0
- tabs/dojo.drawer.html +2 -2
- tabs/dojo.tab.js +7 -4
.gitattributes
CHANGED
|
@@ -100,3 +100,12 @@ assets/default_scene.webp filter=lfs diff=lfs merge=lfs -text
|
|
| 100 |
assets/citizen_skin_color.png filter=lfs diff=lfs merge=lfs -text
|
| 101 |
comic_sheet_v0.png filter=lfs diff=lfs merge=lfs -text
|
| 102 |
comic_koma_sample.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
assets/citizen_skin_color.png filter=lfs diff=lfs merge=lfs -text
|
| 101 |
comic_sheet_v0.png filter=lfs diff=lfs merge=lfs -text
|
| 102 |
comic_koma_sample.png filter=lfs diff=lfs merge=lfs -text
|
| 103 |
+
comic_klein_out/final_bubbles_1234.png filter=lfs diff=lfs merge=lfs -text
|
| 104 |
+
comic_klein_out/final_bubbles_7.png filter=lfs diff=lfs merge=lfs -text
|
| 105 |
+
comic_klein_out/final_notext_1234.png filter=lfs diff=lfs merge=lfs -text
|
| 106 |
+
comic_klein_out/final_notext_7.png filter=lfs diff=lfs merge=lfs -text
|
| 107 |
+
comic_klein_out/raw_bubbles_1234.png filter=lfs diff=lfs merge=lfs -text
|
| 108 |
+
comic_klein_out/raw_bubbles_7.png filter=lfs diff=lfs merge=lfs -text
|
| 109 |
+
comic_klein_out/raw_notext_1234.png filter=lfs diff=lfs merge=lfs -text
|
| 110 |
+
comic_klein_out/raw_notext_7.png filter=lfs diff=lfs merge=lfs -text
|
| 111 |
+
comic_klein_test.png filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
|
@@ -1316,7 +1316,11 @@ def _render_preview_html(
|
|
| 1316 |
let dojoSplatRoot = null;
|
| 1317 |
let dojoSplatHelper = null;
|
| 1318 |
let dojoSplatObjectUrl = null;
|
| 1319 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1320 |
let dojoRoomHeight = 3.2;
|
| 1321 |
let dojoSplatBaseBounds = null;
|
| 1322 |
const dojoFloorSurfaceY = 0.0;
|
|
@@ -1546,7 +1550,9 @@ def _render_preview_html(
|
|
| 1546 |
if (!dojoSplatRoot) return;
|
| 1547 |
const robust = dojoSplatBaseBounds && dojoSplatBaseBounds.robust ? dojoSplatBaseBounds.robust : null;
|
| 1548 |
const rawMax = robust && robust.footprint > 0 ? robust.footprint : (dojoSplatBaseBounds && dojoSplatBaseBounds.maxDim > 0 ? dojoSplatBaseBounds.maxDim : 1.0);
|
| 1549 |
-
|
|
|
|
|
|
|
| 1550 |
const scale = target / rawMax;
|
| 1551 |
const localFloorY = robust ? robust.floorY : 0;
|
| 1552 |
const localCenterX = robust ? (robust.minX + robust.maxX) * 0.5 : 0;
|
|
@@ -3316,7 +3322,7 @@ def _coerce_dojo_inputs(payload_json: str | dict | None) -> tuple[str, int, int,
|
|
| 3316 |
mode = str(raw.get("mode") or "splat").strip().lower()
|
| 3317 |
if mode not in ("splat", "panorama"):
|
| 3318 |
mode = "splat"
|
| 3319 |
-
room_size = float(raw.get("room_size",
|
| 3320 |
room_height = float(raw.get("room_height", 3.2) if raw.get("room_height", 3.2) not in ("", None) else 3.2)
|
| 3321 |
use_panorama_skybox = bool(raw.get("use_panorama_skybox", False))
|
| 3322 |
if seed < 0:
|
|
|
|
| 1316 |
let dojoSplatRoot = null;
|
| 1317 |
let dojoSplatHelper = null;
|
| 1318 |
let dojoSplatObjectUrl = null;
|
| 1319 |
+
// Room size is the dojo FLOOR FOOTPRINT in world metres β the same units as the
|
| 1320 |
+
// ~1.7m character (SMPLX_HEIGHT). fitDojoSplat normalises every splat to this span,
|
| 1321 |
+
// so the character/room proportion is fixed: 6.5m β 3.8 character-heights across
|
| 1322 |
+
// (the character spans ~26% of the floor β a believable small dojo).
|
| 1323 |
+
let dojoRoomSize = 6.5;
|
| 1324 |
let dojoRoomHeight = 3.2;
|
| 1325 |
let dojoSplatBaseBounds = null;
|
| 1326 |
const dojoFloorSurfaceY = 0.0;
|
|
|
|
| 1550 |
if (!dojoSplatRoot) return;
|
| 1551 |
const robust = dojoSplatBaseBounds && dojoSplatBaseBounds.robust ? dojoSplatBaseBounds.robust : null;
|
| 1552 |
const rawMax = robust && robust.footprint > 0 ? robust.footprint : (dojoSplatBaseBounds && dojoSplatBaseBounds.maxDim > 0 ? dojoSplatBaseBounds.maxDim : 1.0);
|
| 1553 |
+
// Normalise the splat footprint to `dojoRoomSize` metres so it stays proportional
|
| 1554 |
+
// to the ~SMPLX_HEIGHT-tall character (room span β dojoRoomSize / 1.7 body-heights).
|
| 1555 |
+
const target = Math.max(SMPLX_HEIGHT * 1.5, dojoRoomSize);
|
| 1556 |
const scale = target / rawMax;
|
| 1557 |
const localFloorY = robust ? robust.floorY : 0;
|
| 1558 |
const localCenterX = robust ? (robust.minX + robust.maxX) * 0.5 : 0;
|
|
|
|
| 3322 |
mode = str(raw.get("mode") or "splat").strip().lower()
|
| 3323 |
if mode not in ("splat", "panorama"):
|
| 3324 |
mode = "splat"
|
| 3325 |
+
room_size = float(raw.get("room_size", 6.5) if raw.get("room_size", 6.5) not in ("", None) else 6.5)
|
| 3326 |
room_height = float(raw.get("room_height", 3.2) if raw.get("room_height", 3.2) not in ("", None) else 3.2)
|
| 3327 |
use_panorama_skybox = bool(raw.get("use_panorama_skybox", False))
|
| 3328 |
if seed < 0:
|
comic_klein_out/final_bubbles_1234.png
ADDED
|
Git LFS Details
|
comic_klein_out/final_bubbles_7.png
ADDED
|
Git LFS Details
|
comic_klein_out/final_notext_1234.png
ADDED
|
Git LFS Details
|
comic_klein_out/final_notext_7.png
ADDED
|
Git LFS Details
|
comic_klein_out/raw_bubbles_1234.png
ADDED
|
Git LFS Details
|
comic_klein_out/raw_bubbles_7.png
ADDED
|
Git LFS Details
|
comic_klein_out/raw_notext_1234.png
ADDED
|
Git LFS Details
|
comic_klein_out/raw_notext_7.png
ADDED
|
Git LFS Details
|
comic_klein_test.png
ADDED
|
Git LFS Details
|
tabs/dojo.drawer.html
CHANGED
|
@@ -52,8 +52,8 @@
|
|
| 52 |
<span>Use panorama as skybox in splat</span>
|
| 53 |
</label>
|
| 54 |
<label class="kimodo-dojo-range" for="kimodo-dojo-room-size">
|
| 55 |
-
<span>Room size <output id="kimodo-dojo-room-size-value">
|
| 56 |
-
<input id="kimodo-dojo-room-size" type="range" min="3" max="14" value="
|
| 57 |
</label>
|
| 58 |
<label class="kimodo-dojo-range" for="kimodo-dojo-room-height">
|
| 59 |
<span>Room height <output id="kimodo-dojo-room-height-value">3.2</output>m</span>
|
|
|
|
| 52 |
<span>Use panorama as skybox in splat</span>
|
| 53 |
</label>
|
| 54 |
<label class="kimodo-dojo-range" for="kimodo-dojo-room-size">
|
| 55 |
+
<span>Room size <output id="kimodo-dojo-room-size-value">6.5</output>m <small style="color:#8a7a5a">(β char Γ<span id="kimodo-dojo-room-ratio">3.8</span>)</small></span>
|
| 56 |
+
<input id="kimodo-dojo-room-size" type="range" min="3" max="14" value="6.5" step="0.5" />
|
| 57 |
</label>
|
| 58 |
<label class="kimodo-dojo-range" for="kimodo-dojo-room-height">
|
| 59 |
<span>Room height <output id="kimodo-dojo-room-height-value">3.2</output>m</span>
|
tabs/dojo.tab.js
CHANGED
|
@@ -9,11 +9,11 @@
|
|
| 9 |
// Community starters β tapping one opens the create view prefilled, so generating
|
| 10 |
// produces a real flux + splat scene (which then lands under "Mine").
|
| 11 |
const COMMUNITY_SEED = [
|
| 12 |
-
{ name: 'Classic dojo', mode: 'splat', settings: { room_size:
|
| 13 |
prompt: 'A traditional martial arts dojo room, polished wooden floor, training mats, wooden wall panels, warm lantern light, full room visible, high detail, no people, no text.' },
|
| 14 |
-
{ name: 'Mountain dojo', mode: '
|
| 15 |
prompt: 'An outdoor mountain dojo courtyard at sunrise, stone tiles, wooden gates, misty trees, full environment visible, high detail, no people, no text.' },
|
| 16 |
-
{ name: 'Neon dojo', mode: 'splat', settings: { room_size:
|
| 17 |
prompt: 'A futuristic neon martial arts training room, glossy floor, holographic wall panels, dramatic rim light, full room visible, no people, no text.' }
|
| 18 |
];
|
| 19 |
|
|
@@ -129,7 +129,7 @@
|
|
| 129 |
function roomSettings() {
|
| 130 |
const els = dojoEls();
|
| 131 |
return {
|
| 132 |
-
room_size: Math.max(1, Number(els.roomSize && els.roomSize.value) ||
|
| 133 |
room_height: Math.max(1, Number(els.roomHeight && els.roomHeight.value) || 3.2),
|
| 134 |
use_panorama_skybox: !!(els.skybox && els.skybox.checked)
|
| 135 |
};
|
|
@@ -145,11 +145,14 @@
|
|
| 145 |
if (frame && frame.contentWindow) frame.contentWindow.postMessage({ kind: 'dojo-scene', scene: payload, image: payload.image }, '*');
|
| 146 |
}
|
| 147 |
|
|
|
|
| 148 |
function updateRoomLabels() {
|
| 149 |
const els = dojoEls();
|
| 150 |
const settings = roomSettings();
|
| 151 |
if (els.roomSizeValue) els.roomSizeValue.textContent = settings.room_size.toFixed(1);
|
| 152 |
if (els.roomHeightValue) els.roomHeightValue.textContent = settings.room_height.toFixed(1);
|
|
|
|
|
|
|
| 153 |
}
|
| 154 |
|
| 155 |
function sendRoomSettings() {
|
|
|
|
| 9 |
// Community starters β tapping one opens the create view prefilled, so generating
|
| 10 |
// produces a real flux + splat scene (which then lands under "Mine").
|
| 11 |
const COMMUNITY_SEED = [
|
| 12 |
+
{ name: 'Classic dojo', mode: 'splat', settings: { room_size: 6.5, room_height: 3.2 },
|
| 13 |
prompt: 'A traditional martial arts dojo room, polished wooden floor, training mats, wooden wall panels, warm lantern light, full room visible, high detail, no people, no text.' },
|
| 14 |
+
{ name: 'Mountain dojo', mode: 'splat', settings: { room_size: 7.5, room_height: 4 },
|
| 15 |
prompt: 'An outdoor mountain dojo courtyard at sunrise, stone tiles, wooden gates, misty trees, full environment visible, high detail, no people, no text.' },
|
| 16 |
+
{ name: 'Neon dojo', mode: 'splat', settings: { room_size: 6.5, room_height: 3.2 },
|
| 17 |
prompt: 'A futuristic neon martial arts training room, glossy floor, holographic wall panels, dramatic rim light, full room visible, no people, no text.' }
|
| 18 |
];
|
| 19 |
|
|
|
|
| 129 |
function roomSettings() {
|
| 130 |
const els = dojoEls();
|
| 131 |
return {
|
| 132 |
+
room_size: Math.max(1, Number(els.roomSize && els.roomSize.value) || 6.5),
|
| 133 |
room_height: Math.max(1, Number(els.roomHeight && els.roomHeight.value) || 3.2),
|
| 134 |
use_panorama_skybox: !!(els.skybox && els.skybox.checked)
|
| 135 |
};
|
|
|
|
| 145 |
if (frame && frame.contentWindow) frame.contentWindow.postMessage({ kind: 'dojo-scene', scene: payload, image: payload.image }, '*');
|
| 146 |
}
|
| 147 |
|
| 148 |
+
var CHAR_HEIGHT_M = 1.7; // character β SMPLX_HEIGHT β room size is shown relative to it
|
| 149 |
function updateRoomLabels() {
|
| 150 |
const els = dojoEls();
|
| 151 |
const settings = roomSettings();
|
| 152 |
if (els.roomSizeValue) els.roomSizeValue.textContent = settings.room_size.toFixed(1);
|
| 153 |
if (els.roomHeightValue) els.roomHeightValue.textContent = settings.room_height.toFixed(1);
|
| 154 |
+
const ratio = document.getElementById('kimodo-dojo-room-ratio');
|
| 155 |
+
if (ratio) ratio.textContent = (settings.room_size / CHAR_HEIGHT_M).toFixed(1);
|
| 156 |
}
|
| 157 |
|
| 158 |
function sendRoomSettings() {
|