stablegen / README.md
multimodalart's picture
multimodalart HF Staff
StableGen texturing demo
f36a9b3 verified
|
Raw History Blame Contribute Delete
2 kB

A newer version of the Gradio SDK is available: 6.32.0

Upgrade
metadata
title: StableGen
emoji: 🎨
colorFrom: green
colorTo: indigo
sdk: gradio
sdk_version: 6.31.0
app_file: app.py
short_description: Texture 3D meshes from a prompt with SDXL projection
python_version: '3.12'
startup_duration_timeout: 30m
license: gpl-3.0

StableGen texturing demo

A ZeroGPU port of the core texturing workflow from StableGen, a Blender add-on by sakalond. It follows the SDXL Default preset with the Generate Sequentially workflow described in the wiki:

  1. Cameras are placed around the mesh, and a depth guide is rendered from each one (normalized and inverted, near = white).
  2. The views are generated one at a time with RealVisXL V5.0, the SDXL-Lightning 8-step LoRA and a depth ControlNet (xinsir/controlnet-depth-sdxl-1.0, strength 0.5), using 8 steps at CFG 1.5.
  3. Each later view inpaints only the regions earlier views have not covered. A render of the texture blended so far is the context, and differential diffusion uses a soft coverage mask (ramp 0.15 to 1.0, grown by 3 px and blurred).
  4. Every view is projected onto the surface. Views are blended per texel with weight cos(angle)^3, taking occlusion into account, and baked into a UV texture (xatlas unwrap). The result is exported as a GLB.

This demo approximates the Blender add-on rather than running it, so the differences are listed here:

  • Rasterization uses nvdiffrast instead of Blender/Cycles.
  • Cameras are placed on an orbit instead of the add-on's normal-weighted auto placement.
  • The add-on's dpmpp_2s_ancestral sampler is replaced by Euler ancestral with trailing spacing.
  • No IPAdapter is used.

Example meshes

The meshes are from the Khronos glTF Sample Assets, all CC0-1.0, with the textures stripped: Suzanne (Norbert Nopper), Lantern (sbtron / Frank Galligan), BarramundiFish and Corset (Microsoft).