[ArtStudio P3] Concept + texturing stages — SDXL concept image with safety checker, PBR texturing, stage chaining #349

Closed
opened 2026-07-04 05:10:54 +00:00 by spikerj · 2 comments
Owner

Sub-ticket of epic #346. Depends on #348 (worker + modeling stage running).

What: the two image-generation stages around modeling — concept (text→reference image, feeds image→3D) and texturing (PBR maps onto the generated mesh) — plus automatic stage chaining so a single student submission flows concept → modeling → texturing without re-submission.

Scope:

  • Concept stage: SDXL-Lightning default (art_pipe models/sdxl_lightning.py), text prompt → reference image artifact; auto-skipped for direct image uploads and text-to-3D models (art_pipe already encodes this skip)
  • Safety checker is mandatory on every generated image (concept output and texture bakes) before it is stored as a servable artifact — NSFW-flagged output fails the stage with a student-friendly message and flags the asset for staff review; unsafe images never reach GridFS serving paths (minors platform; hard requirement, do not ship this stage without it)
  • Texturing stage: Hunyuan3DPaint and/or SD-Turbo texture (per model-fit spike) → base color / metallic / roughness maps + textured GLB artifact
  • Stage chaining: stage.completed handler advances the asset's stage plan and publishes the next stage.requested (orchestration lives in the event handler, mirroring LessonVideoOrchestrator), terminal on failure
  • Per-stage thumbnails/previews (concept PNG, textured-mesh turntable still) via art_pipe enrichment for the library UI
  • Re-run support: RestartFromStageCommand from texturing keeps the modeling output (art_pipe stage artifacts are already per-stage)

Note: prompt-side filtering (blocklist/moderation before the job is accepted) is P6 scope; this ticket owns output-side gating. Decide here whether the concept stage's negative-prompt defaults live in worker config or per-asset-type stage plan.

Acceptance: a text-prompt character submission runs concept → modeling → texturing unattended and yields a textured GLB + concept image + previews in the student's library; an NSFW test prompt produces a failed concept stage, no stored image, and a flagged asset.

Sub-ticket of epic #346. Depends on #348 (worker + modeling stage running). **What:** the two image-generation stages around modeling — concept (text→reference image, feeds image→3D) and texturing (PBR maps onto the generated mesh) — plus automatic stage chaining so a single student submission flows concept → modeling → texturing without re-submission. **Scope:** - [ ] Concept stage: SDXL-Lightning default (art_pipe `models/sdxl_lightning.py`), text prompt → reference image artifact; auto-skipped for direct image uploads and text-to-3D models (art_pipe already encodes this skip) - [ ] **Safety checker is mandatory on every generated image** (concept output and texture bakes) before it is stored as a servable artifact — NSFW-flagged output fails the stage with a student-friendly message and flags the asset for staff review; unsafe images never reach GridFS serving paths (minors platform; hard requirement, do not ship this stage without it) - [ ] Texturing stage: Hunyuan3DPaint and/or SD-Turbo texture (per model-fit spike) → base color / metallic / roughness maps + textured GLB artifact - [ ] Stage chaining: `stage.completed` handler advances the asset's stage plan and publishes the next `stage.requested` (orchestration lives in the event handler, mirroring `LessonVideoOrchestrator`), terminal on failure - [ ] Per-stage thumbnails/previews (concept PNG, textured-mesh turntable still) via art_pipe enrichment for the library UI - [ ] Re-run support: `RestartFromStageCommand` from texturing keeps the modeling output (art_pipe stage artifacts are already per-stage) **Note:** prompt-side filtering (blocklist/moderation before the job is accepted) is P6 scope; this ticket owns output-side gating. Decide here whether the concept stage's negative-prompt defaults live in worker config or per-asset-type stage plan. **Acceptance:** a text-prompt character submission runs concept → modeling → texturing unattended and yields a textured GLB + concept image + previews in the student's library; an NSFW test prompt produces a failed concept stage, no stored image, and a flagged asset.
spikerj added the enhancement label 2026-07-04 05:10:54 +00:00
Author
Owner

P3 scope is now substantially delivered across the merged PRs + one open one:

  • Concept stage (sdxl_lightning) , texturing (sd_turbo_tex) , stage chaining (worker advances the plan, #62), per-stage thumbnails via the enrichment stage (#66), restart-keeps-earlier-artifacts (P1).
  • The mandatory safety checker is PR #67 (awaiting merge): fail-closed NSFW gate on every generated image before GridFS, Falconsai/nsfw_image_detection at threshold 0.3, quarantine bucket + staff-only access, student view sanitized. Live-validated both paths on the Mac stack.

Remaining nuances vs the original ticket text: negative-prompt defaults per asset type (currently model/profile defaults only — thin follow-up if wanted), Hunyuan3DPaint texturing (CUDA-only; Mac uses sd_turbo_tex — #358 tracks the Metal port). Mesh-aware texture baking is noted on #359. Suggest closing this ticket once #67 merges and tracking the nuances where noted.

P3 scope is now substantially delivered across the merged PRs + one open one: - Concept stage (sdxl_lightning) ✅, texturing (sd_turbo_tex) ✅, **stage chaining** ✅ (worker advances the plan, #62), per-stage thumbnails via the enrichment stage ✅ (#66), restart-keeps-earlier-artifacts ✅ (P1). - **The mandatory safety checker is PR [#67](https://git.spikersoft.com/spikerj/spikersoft-backend/pulls/67)** (awaiting merge): fail-closed NSFW gate on every generated image before GridFS, `Falconsai/nsfw_image_detection` at threshold 0.3, quarantine bucket + staff-only access, student view sanitized. Live-validated both paths on the Mac stack. Remaining nuances vs the original ticket text: negative-prompt defaults per asset type (currently model/profile defaults only — thin follow-up if wanted), Hunyuan3DPaint texturing (CUDA-only; Mac uses sd_turbo_tex — #358 tracks the Metal port). Mesh-aware texture baking is noted on #359. Suggest closing this ticket once #67 merges and tracking the nuances where noted.
Author
Owner

PR #67 (safety gate) and PR #69 (kind-aware thresholds, #362) are both merged to master, joining the already-merged chaining/texturing/thumbnail work (#62/#66). All P3 scope is in master; remaining nuances are tracked where noted (negative-prompt defaults — thin follow-up if ever wanted; Hunyuan paint → #358; mesh-aware baking → #359 notes). Closing.

PR #67 (safety gate) and PR #69 (kind-aware thresholds, #362) are both merged to `master`, joining the already-merged chaining/texturing/thumbnail work (#62/#66). All P3 scope is in master; remaining nuances are tracked where noted (negative-prompt defaults — thin follow-up if ever wanted; Hunyuan paint → #358; mesh-aware baking → #359 notes). Closing.
Sign in to join this conversation.