Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Real-ESRGAN integration #233

Merged
merged 6 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
## Installation
Download the [latest release](https://github.com/carson-katri/dream-textures/releases/tag/0.0.6) and follow the instructions there to get up and running.

> On macOS, it is possible you will run into a quarantine issue with the dependencies. To work around this, run the following command in the app `Terminal`: `xattr -r -d com.apple.quarantine ~/Library/Application\ Support/Blender/3.3/scripts/addons/dream_textures/.python_dependencies`. This will allow the PyTorch `.dylib`s and `.so`s to load without having to manually allow each one in System Preferences.

## Usage

| Enter a prompt | Generate a unique texture in a few seconds |
Expand Down
4 changes: 4 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from .tools import TOOLS
from .operators.dream_texture import DreamTexture, kill_generator
from .property_groups.dream_prompt import DreamPrompt
from .operators.upscale import upscale_options

requirements_path_items = (
# Use the old version of requirements-win.txt to fix installation issues with Blender + PyTorch 1.12.1
Expand Down Expand Up @@ -67,6 +68,9 @@ def register():
bpy.types.Scene.dream_textures_progress = bpy.props.IntProperty(name="Progress", default=0, min=0, max=0)
bpy.types.Scene.dream_textures_info = bpy.props.StringProperty(name="Info")

bpy.types.Scene.dream_textures_upscale_outscale = bpy.props.EnumProperty(name="Target Size", items=upscale_options)
bpy.types.Scene.dream_textures_upscale_full_precision = bpy.props.BoolProperty(name="Full Precision", default=True)

for cls in CLASSES:
bpy.utils.register_class(cls)

Expand Down
3 changes: 2 additions & 1 deletion absolute_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ def absolute_path(component):
"""
return os.path.join(os.path.dirname(os.path.realpath(__file__)), component)

WEIGHTS_PATH = absolute_path("stable_diffusion/models/ldm/stable-diffusion-v1/model.ckpt")
WEIGHTS_PATH = absolute_path("stable_diffusion/models/ldm/stable-diffusion-v1/model.ckpt")
REAL_ESRGAN_WEIGHTS_PATH = absolute_path("weights/realesrgan/realesr-general-x4v3.pth")
7 changes: 6 additions & 1 deletion classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
from .operators.dream_texture import DreamTexture, ReleaseGenerator
from .operators.view_history import RecallHistoryEntry, SCENE_UL_HistoryList
from .operators.inpaint_area_brush import InpaintAreaStroke
from .operators.upscale import Upscale
from .property_groups.dream_prompt import DreamPrompt
from .ui.panel import panels, history_panels, troubleshooting_panels
from .ui.panel import panels, history_panels, troubleshooting_panels, upscaling_panels, OpenRealESRGANDownload, OpenRealESRGANWeightsDirectory
from .preferences import OpenGitDownloads, OpenHuggingFace, OpenWeightsDirectory, OpenRustInstaller, ValidateInstallation, StableDiffusionPreferences

CLASSES = (
Expand All @@ -13,10 +14,14 @@
OpenLatestVersion,
RecallHistoryEntry,
InpaintAreaStroke,
Upscale,
SCENE_UL_HistoryList,
*panels(),
*upscaling_panels(),
*history_panels(),
*troubleshooting_panels(),
OpenRealESRGANDownload,
OpenRealESRGANWeightsDirectory
)

PREFERENCE_CLASSES = (
Expand Down
Loading