10 Commits
Author SHA1 Message Date
PozzettiAndrea a342f20402 Serve frontend JS from javascript/, keep vendor bundles out of the main realm
Move web/ to javascript/ and declare it via [tool.comfy] web.

Rename the seven third-party bundles (playcanvas, spark, three.js, gsplat,
OrbitControls, TrackballControls) to .mjs. Every reference to them is inside the
HTML viewers, but ComfyUI auto-imports **/*.js under the web dir into the shared
browser realm, so ~8MB of vendor code was being evaluated in the main page on
every startup -- and with it 36 collision errors: document.body injection,
document-level listeners, unguarded message listeners and self.onmessage writes.
The importmap values, script srcs and three.module's internal ./three.core ref
are rewritten to match.

DisplayName becomes "GaussianPack": the namespace enforced on
registerExtension names is derived from it, and "ComfyUI-GaussianPack" made
that prefix invalid. The analysis extension is renamed to match.

js/gaussian_preview.js hooked "PlyPreviewLoadGaussianPLYEnhance", a node id
that appears nowhere in this repo, so the PLY dropdown auto-refresh had never
run; it now targets LoadPLY and LoadPLYOutput, the two nodes that actually carry
the ply_file widget. Guard its message listener on event.source.

Asset seeding resolves the input directory through
folder_paths.get_input_directory(), so it follows ComfyUI Desktop and
--input-directory instead of writing into the code tree.

comfy-test.toml moves to the current schema: [test.workflows] cuda (there is
no "gpu" key -- the accelerator is named by backend, and the old spelling parsed
to an empty list, so CUDA runners silently ran the full unfiltered set), an
explicit [test.platforms] platforms allowlist (per-platform booleans are no
longer supported), and the javascript level.
2026-08-22 20:56:09 +02:00
PozzettiAndrea 6753db6f21 added viewer node for geometrypack 2026-06-07 19:16:51 +02:00
PozzettiAndreaandClaude Opus 4.8 f927d3d638 README + icon + gallery preview (dev)
- README: add SAM3-style 3-option install (Manager / Git URL / manual) and a
  "report problems" note; keep the live gallery link + demo video.
- assets/icon.png (400x400) cropped from the apple-splat preview screenshot.
- assets/gallery-preview.png: screenshot of the dev/linux-cpu test gallery
  (4/4 passing). README image points at the dev raw URL; the gallery link still
  points at the live gh-pages results.
- pyproject.toml: set Icon (dev raw URL) and add the comfy-env install warning
  to the description.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 09:00:00 +02:00
PozzettiAndrea 6f8632efff bump 2026-05-19 17:51:45 +02:00
Andrea Pozzetti 872a9620eb pyproject: fix PublisherId pozzettiandrea -> pznodes; drop comfy-env warning (not used here) 2026-05-19 12:37:20 +02:00
PozzettiAndrea e0364a9f5f docs: warn about experimental comfy-env install in README + pyproject 2026-05-16 21:39:13 +02:00
PozzettiAndrea 9137508fba Re-add GaussianMerge + Lito structure; rename to GaussianPack; trackball camera
The prior commit (6908dbe) was lost when the local repo was re-cloned
before its push could land. Redoing the full GaussianPack-side work
in one pass, plus two new asks from this session:

1. Display name: "Preview Gaussians Turntable" -> "Preview Gaussians".
2. Camera: OrbitControls -> TrackballControls. ParaView-style free
   rotation — no fixed up vector, no gimbal lock at the poles, can
   roll the camera. Replaces the "bound at azimuth and bottom" feel.

## Rename (mechanical sed pass)

  ComfyUI-GSViewer -> ComfyUI-GaussianPack
  GSViewer         -> GaussianPack         (log tags, extension name)
  gsviewer         -> gaussianpack         (route path, logger name)
  GSVIEWER         -> GAUSSIANPACK

Hit __init__.py, spz_route.py, pyproject.toml, comfyui_extension.json,
README.md, web/js/gaussian_preview.js.

## LiTo-style project structure

- comfy-test.toml       — test matrix; workflow-level testing
                           happens downstream in ComfyUI-LiTo.
- comfy-env-root.toml   — empty [node_reqs]; GaussianPack has no
                           downstream custom-node deps.
- comfy-env.toml        — numpy + plyfile + NanoGS via pypi-git.
- install.py            — two-liner mirroring LiTo's.
- requirements.txt      — DELETED, superseded by comfy-env.toml.

## GaussianMerge node

merge_gaussians.py: takes a 3DGS .ply + target_count, writes a slimmer
.ply via NanoGS pairwise merging (MPMM — same algorithm
@playcanvas/splat-transform's `--decimate` uses). Pure Python, CPU only;
the upstream paper notes a CUDA port as future work. ~10-30s for 1M ->
200K splats.

Lazy-imports nanogs.simplification + nanogs.utils.params inside the
merge method to keep import cost off ComfyUI startup. Caches via
mtime + (target_count, opacity_threshold, k) sidecar — re-running with
the same inputs is a no-op.

Pass-through if target >= input. ratio is clamped to NanoGS's required
open (0, 1) interval.

Node parameters:
  ply_path           STRING, forceInput
  target_count       INT, default 200_000
  output_filename    STRING, default "merged"
  opacity_threshold  FLOAT, default 0.1
  k                  INT, default 16

## Camera: TrackballControls

Vendored web/js/TrackballControls.js (three@0.169.0, ~18 KB) +
importmap entry alongside OrbitControls. The viewer now constructs
TrackballControls with rotateSpeed=3.5, zoomSpeed=1.2, panSpeed=0.8,
staticMoving=true (no inertia drift). ResizeObserver now calls
controls.handleResize() so mouse-to-NDC mapping stays correct after
canvas resize. .target / .update() / .enabled API surface is identical
between OrbitControls and TrackballControls — no callsite changes
needed in gaussian_preview.js.

OrbitControls.js stays vendored (still in importmap) for any future
node that wants the constrained "preserve up" behavior.

Workflow chain (LiTo apple):
  LoadImage -> LiToImageTo3D -> LiToExportPLY (~225 MB raw)
                                       |
                               GaussianMerge(target=200_000)
                                       |
                               PreviewGaussians (~50 MB)
2026-05-15 18:28:38 +02:00
PozzettiAndrea b60d7f5b8d Rename to ComfyUI-GSViewer; robust onConfigure migration
* Bulk rename "ComfyUI-TurntableGSViewer" -> "ComfyUI-GSViewer" across
  package metadata, route prefix (/turntablegsviewer/spz ->
  /gsviewer/spz), logger name, extension id, and all console-log tags.
* Extend onConfigure to defend against stale workflow schemas: rescues
  stranded camera-state JSON into properties["Camera Config"] and
  resets combo widgets whose value isn't in the option list. Fixes the
  validator-reject when an old-schema basic.json (camera state glued
  into widgets_values[3]) is loaded against today's renderer combo.
2026-05-14 15:07:22 +02:00
PozzettiAndrea 5e6b102b2d save coords in json 2026-05-13 00:00:18 +02:00
PozzettiAndreaandClaude Opus 4.7 1dd817b154 initial copy from comfyui-PlyPreview as ComfyUI-TurntableGSViewer base
Copy of XuanYu-github/comfyui-PlyPreview (GPL-3.0) repackaged under
new name and ownership. Metadata changes only:
- pyproject.toml: project name + URLs + tool.comfy.DisplayName
- comfyui_extension.json: name / author / repo
- removed .github/workflows/publish_action.yml (upstream's auto-publish)

Internal class names, NODE_CLASS_MAPPINGS keys, CATEGORY strings,
and source code are intact for further customization.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 21:12:59 +02:00