Introduction¶
When working with 3D or game-oriented assets in DeepSeek Harness (DSH), a common requirement is to transform a field photo into engine-ready PBR textures (albedo, normal, roughness, etc.) that can also be seamlessly tiled. Doing this manually in a DCC tool—splitting channels, using MakeSeamless, and exporting multiple maps—involves many steps and is difficult to reproduce reliably within a conversation. A community skill concept already exists (pbr-material-from-photo): the model handles judgment and prompting, while the pipeline runs locally via ComfyUI. The plugin dsh-pbr-material (maintainer: zhangx413, Category: Model Inference) packages this capability into a DSH plugin. It moves the deterministic pipeline into code, provides a GUI workbench and agent tools, and performs inference locally using ComfyUI and approximately 12.5 GB of weights, without relying on cloud-based image generation APIs.
What is this¶
dsh-pbr-material is a DSH plugin that takes a photo of an object or material surface as input and outputs a complete set of tileable PBR textures (albedo / normal / height / roughness / AO / curvature / metallic, with data maps in 16-bit). The entire process executes locally on ComfyUI. The generative path uses FLUX.2 Klein 4B for instruction-based editing to obtain a flat albedo, then derives the remaining channels via a fixed pipeline (hue-selective color grading → MakeSeamless → PBRSynth → 16-bit writing to disk). It also provides tiling measurements and 3×3 previews. The plugin includes a GUI workbench, five agent tools, and deployment utilities capable of discovering ComfyUI, setting up an independent run root, and resuming weight downloads. It does not write into the user’s existing ComfyUI directory, utilizing its own run root and port.
- Directory Page: https://www.skillhub.cn/plugins/zhangx413/dsh-pbr-material
- Source Code: https://github.com/zhangx413/dsh-pbr-material (MIT, current package version 0.2.0, requires Node >= 20)
Core Features¶
Division of Labor between Skill and Code¶
The README uses a table to clarify boundaries: judgment capabilities such as failure modes, hard limits, and prompt structure order remain in the skill (SKILL.md); while deterministic steps such as submitting and polling the 19-node ComfyUI graph, prompt templates, the fixed post-processing pipeline, and tiling measurement/preview are moved into the plugin code. This allows the agent to still make decisions based on the skill, while the execution layer avoids reconnecting and rebuilding the graph in every conversation.
Two Modes (Choosing the wrong one is the most common failure)¶
mode="direct" (Direct Pass-through) |
mode="generate" (Generative, Default) |
|
|---|---|---|
| Meaning | The photo is the albedo; only performs tiling + derivation | First redraws into a flat albedo using FLUX.2 Klein, then derives |
| Duration | ~3 seconds | ~30 seconds at 1024px / 20 steps |
| Resolution | Preserves the photo’s native resolution | Outputs as a square image of size×size |
| Details | Preserves real seams, aggregates, stains, etc. | Details are replaced by “plausible” generic textures |
| Description | Not required (material is ignored) |
Needs clear description of color, base, and wear |
| Use Case | Already frontal tileable textures (walls, floors, scans, etc.) | Photos with objects, perspective, background, or lighting gradients |
regarding a photo of a concrete wall that is already a frontal tileable texture, the README notes: generate will erase vertical seams, aggregates, and water stain color variations; direct preserves the original image. This is explicitly selected in the second step of the panel; on the agent side, it is specified via the mode parameter of pbr_material_from_photo.
Five Agent Tools¶
| Tool | Function |
|---|---|
pbr_comfy_status |
Checks installation, Python, model files, node packages, run root, free VRAM, and running instances. |
pbr_material_from_photo |
Full pipeline with mode="direct" / "generate", returns texture paths and tiling measurements. |
pbr_check_maps |
Performs tiling measurement and generates 3×3 previews for existing texture sets. |
pbr_setup_status |
Environment self-check (path sources, missing weights, disk; optional probe_speed to estimate download time). |
pbr_setup_install |
Background deployment: verify environment → run root → node packages → download weights → start instance for verification. |
Instance Strategy: Prefers attaching to an already running ComfyUI via attachPorts; if not found, starts a headless instance on an independent port (default 8288) and closes it after completion. Before starting an instance, it checks free VRAM; if below minFreeVramMiB (default 9000 MiB), it reports an error to avoid OOM.
GUI Workbench¶
The sidebar PBR Material opens a full-page workbench: environment bar, reference image drag-and-drop or Ctrl+V, mode selection (hides Chinese intent and English FLUX description areas when in direct mode), output directory and asset naming, advanced parameters, background task progress, and result area (PASS / veto / FAIL for each texture, 3×3 tiling preview). The generate button connects directly to the host REST API, not blocking the conversation. When writing English material descriptions, it calls the DSH llm service (ctx.get('llm')); the plugin itself does not hold API keys. The multimodal model is determined by host configuration.
Output Naming and File Layout¶
After filling in the asset category / name / version in the panel, the file plan is aligned with the host via GET api/naming. One folder per material set, e.g., T_Military_SandBag_01 containing _C, _N, _R, _AO, _M, _H, _CURV, as well as engine combined maps _CA, _CH, _NRM, plus manifest.json and reference images/3×3 previews in preview/. Suffixes come from naming.suffixes in config.json.
Installation and Activation¶
The plugin is installed into the DSH profile as a bundle. The steps provided in the official README are as follows (after unzipping a ZIP or cloning to any directory):
node scripts\install-into-dsh.mjs --dry-run # Preview what will be modified
node scripts\install-into-dsh.mjs # Perform actual installation
# Then restart DeepSeek Harness
The script creates a junction from this directory to <profile>\node_modules\dsh-pbr-material and writes to the profile’s dsh.profile.bundles and dependencies. It backs up package.json before modification.
Once installed, say “Check the PBR plugin environment” in the conversation. The agent can call pbr_setup_status, pbr_setup_status(probe_speed), and pbr_setup_install in sequence to complete path discovery, node package setup, run root configuration, and download/verification of missing weights. The first three items are handled automatically by the plugin; however, the machine must have ComfyUI installed and approximately 12.5 GB of model weights prepared (resumable downloads with mirror fallback supported).
Typical Usage¶
Running the full pipeline with the Agent¶
Once the environment is ready, instruct the agent to call pbr_material_from_photo: use mode="direct" if the reference image is already a tileable texture; use mode="generate" with a well-written material description if there is perspective or objects. Call pbr_check_maps if you only need to check existing textures.
Using the Panel without occupying the conversation¶
- Open the PBR Material workbench and confirm the ComfyUI, model, and instance status in the environment bar.
- Import the reference image and select “Direct Derivation” or “Generate then Derive”.
- In generative mode, fill in the Chinese intent (optionally “Let the model look at the image and write an English description”) and confirm the English sentence used for FLUX.
- Select the output parent directory, fill in category / name / version, and click Generate; view measurements and 3×3 previews in the result area, and “Open Output Folder” if necessary.
The panel REST endpoints include POST api/generate (background task), POST api/draft (multimodal description writing), POST api/check (measure existing sets), etc., sharing the same pipeline logic as the agent tools.
Use Cases and Precautions¶
Suitable for: Teams or individuals who need to produce tileable PBR sets from photos locally (batch or interactive) and are willing to maintain ComfyUI and VRAM (the README mentions that running two instances of Klein 4B + text encoder simultaneously is not recommended on 16 GB VRAM).
Precautions:
- The plugin runs with the permissions of the current DSH process. Please read the source code and MIT license before installation, and confirm the source of weights and disk usage.
- Do not mistakenly enable
generatefor textures that are already finished products; it wastes time and loses detail. - The community directory SkillHub has no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem is “everything is a plugin,” and this plugin is one of the community-maintained model inference extensions.
Conclusion¶
dsh-pbr-material consolidates the “Photo → Tileable PBR Texture Set” workflow into a single chain within DSH that is conversational, panel-based, and executes locally via ComfyUI. It distinguishes between direct and generative modes to avoid repainting existing textures into generic AI textures. For further details on capabilities and installation, please refer to the directory page and the GitHub README.
- Directory: https://www.skillhub.cn/plugins/zhangx413/dsh-pbr-material
- Repository: https://github.com/zhangx413/dsh-pbr-material