Skip to content

Commit

Permalink
Custom Checkpoints, SDXL support, ran into a brickwall with the laten…
Browse files Browse the repository at this point in the history
…t mixing pipeline will pick it up later
  • Loading branch information
FrederikHasecke committed Jan 11, 2025
1 parent a790cde commit 9cb2935
Show file tree
Hide file tree
Showing 20 changed files with 1,423 additions and 659 deletions.
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"configurations": [
{
"name": "Python Debugger: Python File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"justMyCode": false,
}
]
}
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

DiffusedTexture is a Blender add-on that uses Stable Diffusion to create textures directly on 3D meshes.

![https://www.cgtrader.com/free-3d-print-models/miniatures/other/elephant-natural-history-museum-1](https://github.com/FrederikHasecke/diffused-texture-addon/blob/master/images/elephant.gif)
![https://graphics.stanford.edu/data/3Dscanrep/](https://github.com/FrederikHasecke/diffused-texture-addon/blob/master/images/rabbit.gif)
![General Usage](https://github.com/FrederikHasecke/diffused-texture-addon/blob/master/images/usage.gif)

## Table of Contents
- [DiffusedTexture: AI-Powered Texture Generation for Blender](#diffusedtexture-ai-powered-texture-generation-for-blender)
- [Table of Contents](#table-of-contents)
- [Examples](#examples)
- [Features](#features)
- [Installation (Windows)](#installation-windows)
- [Installation (Linux)](#installation-linux)
Expand All @@ -19,6 +19,11 @@ DiffusedTexture is a Blender add-on that uses Stable Diffusion to create texture
- [**Roadmap**](#roadmap)
- [**Acknowledgements**](#acknowledgements)

## Examples
![https://www.cgtrader.com/free-3d-print-models/miniatures/other/elephant-natural-history-museum-1](https://github.com/FrederikHasecke/diffused-texture-addon/blob/master/images/elephant.gif)
![https://graphics.stanford.edu/data/3Dscanrep/](https://github.com/FrederikHasecke/diffused-texture-addon/blob/master/images/rabbit.gif)


## Features
- **AI-Driven Texture Creation:** Generate diffuse textures directly on 3D models
- **Modes for Different Workflows:**
Expand All @@ -31,10 +36,10 @@ DiffusedTexture is a Blender add-on that uses Stable Diffusion to create texture
## Installation (Windows)
0. Download [7-Zip](https://7-zip.de/download.html)
1. Download all .tar files of the [latest release](https://github.com/FrederikHasecke/diffused-texture-addon/releases/latest)
2. Untar the file `diffused_texture_addon-0.0.1-windows_x64.7z.001` this will automatically untar the other `.7z` files
>**WARNING:** _DO NOT_ unzip the resulting `diffused_texture_addon-0.0.1-windows_x64.zip`
2. Untar the file `diffused_texture_addon-0.0.2-windows_x64.7z.001` this will automatically untar the other `.7z` files
>**WARNING:** _DO NOT_ unzip the resulting `diffused_texture_addon-0.0.2-windows_x64.zip`
3. If you did not already do so: **__You need to "Allow Online Access" under "System" in the Preferences.__**
4. Install the `diffused_texture_addon-0.0.1-windows_x64.zip` file in Blender as an Add-On.
4. Install the `diffused_texture_addon-0.0.2-windows_x64.zip` file in Blender as an Add-On.
- `Edit` -> `Preferences...` -> Sidebar `Add-ons` -> Top right corner dropdown menu -> `Install from Disk...`

![Installatíon](https://github.com/FrederikHasecke/diffused-texture-addon/blob/master/images/install.png)
Expand All @@ -55,8 +60,6 @@ DiffusedTexture is a Blender add-on that uses Stable Diffusion to create texture

## Usage

![General Usage](https://github.com/FrederikHasecke/diffused-texture-addon/blob/master/images/usage.gif)

1. **Load a 3D Model**:
- Import or create a `.blend` file containing the 3D model.
2. **UV Unwrap the Model**:
Expand Down
36 changes: 31 additions & 5 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
from .operators import OBJECT_OT_GenerateTexture, OBJECT_OT_SelectPipette
from .panel import (
OBJECT_PT_MainPanel,
OBJECT_OT_OpenNewInputImage,
OBJECT_PT_IPAdapterPanel,
OBJECT_OT_OpenNewIPAdapterImage,
OBJECT_PT_LoRAPanel,
OBJECT_PT_AdvancedPanel,
)


Expand Down Expand Up @@ -85,13 +87,35 @@ class DiffuseTexPreferences(bpy.types.AddonPreferences):
def draw(self, context):
layout = self.layout

# Add a text block to explain that the user needs to explicitly allow online access
box = layout.box()
row = box.row()
row.label(text="Please ensure that Blender is allowed to access the internet")
row = box.row()
row.label(text="in order to install models. Do so in:")
row = box.row()
row.label(text="Preferences > System > Network > Allow Online Access.")

# HuggingFace Cache Path setting
layout.prop(self, "hf_cache_path", text="HuggingFace Cache Path")

# Button to execute the model installation function
layout.operator(
InstallModelsOperator.bl_idname, text="Install Models", icon="IMPORT"
)
# make the Install Models button unavailable if the "online access" is disabled
if not bpy.app.online_access:
layout.label(
text="Online access is disabled. Enable it in Preferences > System > Network > Allow Online Access."
)

row = layout.row()
row.enabled = False
row.operator(
InstallModelsOperator.bl_idname, text="Install Models", icon="IMPORT"
)

else:
# Button to execute the model installation function
layout.operator(
InstallModelsOperator.bl_idname, text="Install Models", icon="IMPORT"
)


classes = [
Expand All @@ -100,9 +124,11 @@ def draw(self, context):
OBJECT_OT_GenerateTexture,
OBJECT_OT_SelectPipette,
OBJECT_PT_MainPanel,
OBJECT_PT_LoRAPanel,
OBJECT_OT_OpenNewInputImage,
OBJECT_PT_AdvancedPanel,
OBJECT_PT_IPAdapterPanel,
OBJECT_OT_OpenNewIPAdapterImage,
OBJECT_PT_LoRAPanel,
]


Expand Down
2 changes: 1 addition & 1 deletion blender_manifest.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
schema_version = "1.0.0"

id = "diffused_texture_addon"
version = "0.0.1"
version = "0.0.2"
name = "DiffusedTexture"
tagline = "Generate Diffuse Textures on Meshes with Stable Diffusion"
maintainer = "Frederik Hasecke <[email protected]>"
Expand Down
Loading

0 comments on commit 9cb2935

Please sign in to comment.