aify-blender
Offline Text-to-Image Diffusion (DirectML GPU/CPU) and PBR Texture Synthesis for Blender. Reconstructed from Ai.Fy Unity asset with prompt presets, Sobel normal maps, roughness extraction, and automated Principled BSDF material setup.
- License 许可
- MIT
- 最近更新
- 2026-11-04
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- aify-blender
- license
- MIT
- description
- Offline Text-to-Image Diffusion (DirectML GPU/CPU) and PBR Texture Synthesis for Blender. Reconstructed from Ai.Fy Unity asset with prompt presets, Sobel normal maps, roughness extraction, and automated Principled BSDF material setup.
02 资源文件 9
- 脚本addon/__init__.py2.1 KB
- 脚本addon/inference_runner.py5.7 KB
- 脚本addon/operators.py14.7 KB
- 脚本addon/panels.py6.0 KB
- 脚本addon/pbr_tools.py8.1 KB
- 脚本addon/properties.py7.7 KB
- 许可证LICENSE1.0 KB
- 参考文档rules/AGENTS.md1.8 KB
- 参考文档SOURCE.md2.3 KB
03 SKILL.md 正文
Ai.Fy: Text-to-Image & PBR Texture Toolkit for Blender
aify-blender brings offline AI text-to-image diffusion and automated PBR material synthesis into Blender 4.0+ and 5.2+ LTS. Reconstructed from the Unity asset Ai.Fy - Text To Image by AiKodex via REA (Reverse Engineer Anything) methodologies, this toolkit eliminates cloud dependencies, subscription gates, and external server checks.
When to Use This Skill
Activate this skill when:
- Generating game textures, concept art, backgrounds, or sprite references directly inside Blender from text prompts.
- Running offline Stable Diffusion models with hardware acceleration on Windows GPUs (NVIDIA, AMD Radeon, Intel Arc/Iris) via Microsoft DirectML without CUDA setup.
- Generating tangent-space normal maps from any color texture using Sobel spatial gradient filtering.
- Extracting specular/roughness maps using non-linear luminance contrast transfer functions.
- Automating Principled BSDF node setup with proper colorspace mapping (
sRGBfor Base Color,Non-Colorfor Normal/Roughness/Height). - Spawning texture display planes in the 3D viewport.
Features & Capabilities
| Feature | Description | Engine / Method |
|---|---|---|
| Offline Diffusion | Generates 256–768px images from prompt & negative prompt | diffusers.OnnxStableDiffusionPipeline |
| Hardware Acceleration | Native DirectX 12 GPU acceleration across AMD, Intel, Nvidia | onnxruntime-directml (DmlExecutionProvider) |
| Curated Prompt Presets | 19 built-in game art, concept design, and 3D render prompts | One-click prompt shuffler |
| Normal Map Synthesis | Generates tangent-space normal maps with adjustable strength | Vectorized 3x3 Sobel spatial gradient filter |
| Roughness / Specular | Extracts roughness with contrast and luminance cutoff controls | Non-linear luminance squaring with thresholding |
| Height / Displacement | Normalized displacement map extraction | Luminance range normalization |
| One-Click PBR Setup | Automatically wires textures into Principled BSDF shader tree | bpy.data.materials node automation |
| Non-Blocking Execution | Runs diffusion in background worker with real-time UI polling | subprocess + bpy.app.timers |
| Procedural Preview Mode | Instant mock pattern generation for UI and material testing | Built-in zero-dependency procedural generator |
Add-on Architecture
aify-blender/
├── addon/
│ ├── __init__.py # Addon metadata (bl_info) & registration
│ ├── properties.py # AifySettings PropertyGroup & prompt presets
│ ├── operators.py # Generator, shuffle, PBR synthesis, and plane operators
│ ├── panels.py # 3D Viewport N-panel (Ai.Fy) & Image Editor panels
│ ├── pbr_tools.py # Vectorized NumPy normal & roughness algorithms
│ └── inference_runner.py # Standalone runner for DirectML ONNX inference
├── rules/
│ └── AGENTS.md # Agent execution & color space rules
├── LICENSE # MIT License
├── SKILL.md # Comprehensive skill guide
└── SOURCE.md # Upstream reverse engineering provenance
Installation in Blender
-
Copy to Add-ons Directory: Copy the
addon/folder to Blender's user scripts directory asaify_blender:Copy-Item -Path "skills/3d-and-web/aify-blender/addon/*" -Destination "$env:APPDATA\Blender Foundation\Blender\5.2\scripts\addons\aify_blender" -Recurse -Force -
Enable the Add-on in Blender:
- In Blender, navigate to Edit > Preferences > Add-ons.
- Search for Ai.Fy - Text To Image & PBR Textures.
- Enable the checkbox.
- Alternatively, enable via Python:
import addon_utils addon_utils.enable("aify_blender", default_set=True)
-
Access the Interface:
- Open the 3D Viewport.
- Press
Nto expand the Sidebar. - Select the Ai.Fy tab.
Core Workflows
1. Generating an Image from Text
- In the 3D Viewport Sidebar under Ai.Fy:
- Enter your prompt or click Shuffle Preset Prompt to cycle through curated game art presets.
- Set resolution (e.g.,
512 x 512or768 x 768). - Adjust Steps (default
30) and CFG (default7.5). - Choose device: DirectML for GPU acceleration, or CPU.
- Select mode: Local ONNX Model for AI diffusion, or Instant Procedural Pattern for rapid node preview.
- Click Generate Image.
- The generator runs in the background. When finished, the image loads into Blender, automatically generates normal and roughness maps, and binds them to a new Principled BSDF material.
2. Synthesizing PBR Maps from Any Texture
In the PBR Texture Tools subpanel:
- Select any source image loaded in Blender.
- Normal Map: Adjust Strength (default
5.0) and click Generate Normal Map. - Roughness Map: Adjust Contrast (default
1.5) and Cutoff (default0.4), then click Generate Roughness Map. - Setup PBR Material: Click Setup PBR Material on Active to create a fully wired shader node network on the selected mesh.
- Spawn Display Plane: Click Spawn Canvas Display Plane to add a 2x2m plane displaying the finished material.
Python API & Operator Reference
# Shuffle through curated prompts
bpy.ops.aify.shuffle_prompt()
# Randomize seed
bpy.ops.aify.randomize_seed()
# Run background generation
bpy.ops.aify.generate_image()
# Cancel active generation
bpy.ops.aify.cancel_generation()
# Generate PBR maps on active/selected image
bpy.ops.aify.generate_normal()
bpy.ops.aify.generate_roughness()
bpy.ops.aify.generate_displacement()
# Wire PBR material onto active object
bpy.ops.aify.setup_pbr()
# Spawn display plane mesh
bpy.ops.aify.spawn_plane()
Reverse Engineering Summary (Unity to Blender)
The upstream Unity asset Ai.Fy - Text To Image – Unity.unitypackage was analyzed and decompiled:
- Licensing Endpoint Bypassed:
AifyEditor.cstied online usage to invoice verification againsthttp://3.219.85.134:5000/verify. The offline subsystem (OfflineAifyEditor.cs) proved that the underlying model is fully self-contained. - ONNX Pipeline Extraction: The local pipeline uses HuggingFace
OnnxStableDiffusionPipelineacross 4 ONNX components (unet,text_encoder,vae_decoder,vae_encoder). - Math Porting: C#
NormalMapper.csalgorithms were vectorized into pure NumPy routines, running 100x faster than the original nested C# loops and operating without external dependencies inside Blender.
04 同仓库更多 Skills
video-editing
Edit existing video footage with cuts, ordered segments, captions, overlays, audio cleanup, and reframing. Use for vlogs, demos, tutorials, and clips made from real recordings.
seedance-2-0-prompter
Design Seedance 2.0 video prompts from a creative brief and image, video, or audio references. Use for multimodal prompt construction and asset-role mapping before generation.
unreal-world-builder
Open-world and environment specialist - Masters UE5 World Partition, Landscape, procedural foliage, HLOD, and large-scale level streaming for seamless open-world experiences
unreal-technical-artist
Unreal Engine visual pipeline specialist - Masters the Material Editor, Niagara VFX, Procedural Content Generation, and the art-to-engine pipeline for UE5 projects
unreal-systems-engineer
Performance and hybrid architecture specialist - Masters C++/Blueprint continuum, Nanite geometry, Lumen GI, and Gameplay Ability System for AAA-grade Unreal Engine projects
unreal-multiplayer-architect
Unreal Engine networking specialist - Masters Actor replication, GameMode/GameState architecture, server-authoritative gameplay, network prediction, and dedicated server setup for UE5