Skip to content

Commit

Permalink
Release v0.3.0 (#711)
Browse files Browse the repository at this point in the history
* Bump version #

* Ensure refiner is not None when loading in prompt_to_image (#716)

* Fix depth projection with ControlNet (#717)

* Add workaround for AutoPipeline.from_pipe with ControlNet (#720)

* Upgrade diffusers and remove workaround (#721)
  • Loading branch information
carson-katri authored Nov 4, 2023
1 parent fb1d1d0 commit 4f210c5
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "Dream Textures contributors",
"description": "Use Stable Diffusion to generate unique textures straight from the shader editor.",
"blender": (3, 1, 0),
"version": (0, 2, 0),
"version": (0, 3, 0),
"location": "Image Editor -> Sidebar -> Dream",
"category": "Paint"
}
Expand Down
2 changes: 1 addition & 1 deletion generator_process/actions/load_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def _convert_pipe(cache, model, pipe, model_class, half_precision, scheduler, **
if model_class.__name__ not in {
# some tasks are not supported by auto pipeline
'DreamTexturesDepth2ImgPipeline',
'StableDiffusionUpscalePipeline'
'StableDiffusionUpscalePipeline',
}:
pipe = model_class.from_pipe(pipe, **kwargs)
scheduler.create(pipe)
Expand Down
2 changes: 1 addition & 1 deletion generator_process/actions/prompt_to_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def prompt_to_image(
device = self.choose_device(optimizations)

# Stable Diffusion pipeline w/ caching
if device == "cuda" and (optimizations.cpu_offloading(device) or torch.cuda.mem_get_info()[1] > 20 * 1024**3 * (1 if optimizations.can_use_half(device) else 2)):
if sdxl_refiner_model is not None and device == "cuda" and (optimizations.cpu_offloading(device) or torch.cuda.mem_get_info()[1] > 20 * 1024**3 * (1 if optimizations.can_use_half(device) else 2)):
pipe, refiner = self.load_model(diffusers.AutoPipelineForText2Image, model, optimizations, scheduler, sdxl_refiner_model=sdxl_refiner_model)
else:
pipe = self.load_model(diffusers.AutoPipelineForText2Image, model, optimizations, scheduler)
Expand Down
20 changes: 11 additions & 9 deletions operators/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,24 @@

def _validate_projection(context):
if len(context.selected_objects) == 0:
def fix_selection(context, layout):
if context.object.mode != 'OBJECT':
layout.operator("object.mode_set", text="Switch to Object Mode", icon="OBJECT_DATAMODE").mode = 'OBJECT'
layout.operator("object.select_by_type", text="Select All Meshes", icon="RESTRICT_SELECT_OFF").type = 'MESH'
def object_mode_operator(operator):
operator.mode = 'OBJECT'
def select_by_type_operator(operator):
operator.type = 'MESH'
raise FixItError(
"""No objects selected
Select at least one object to project onto.""",
fix_selection
FixItError.RunOperator("Switch to Object Mode", "object.mode_set", object_mode_operator)
if context.object.mode != 'OBJECT'
else FixItError.RunOperator("Select All Meshes", "object.select_by_type", select_by_type_operator)
)
if context.object is not None and context.object.mode != 'EDIT':
def fix_mode(_, layout):
layout.operator("object.mode_set", text="Switch to Edit Mode", icon="EDITMODE_HLT").mode = 'EDIT'
def fix_mode(operator):
operator.mode = 'EDIT'
raise FixItError(
"""Enter edit mode
In edit mode, select the faces to project onto.""",
fix_mode
FixItError.RunOperator("Switch to Edit Mode", "object.mode_set", fix_mode)
)
has_selection = False
for obj in context.selected_objects:
Expand All @@ -63,7 +65,7 @@ def fix_mode(_, layout):
raise FixItError(
"""No faces selected.
Select at least one face to project onto.""",
lambda ctx, layout: None
FixItError.RunOperator("Select All Faces", "mesh.select_all", lambda _: None)
)

def dream_texture_projection_panels():
Expand Down
1 change: 0 additions & 1 deletion property_groups/dream_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ def generate_args(self, context, iteration=0, init_image=None, control_images=No
net.conditioning_scale
)
for i, net in enumerate(self.control_nets)
if net.control_image is not None
]
)

Expand Down
2 changes: 1 addition & 1 deletion requirements/linux-rocm.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
diffusers==0.20.2
git+https://github.com/huggingface/diffusers.git@d1222064669a758c476014fb7a09e24a0c907222
invisible-watermark
transformers
accelerate
Expand Down
2 changes: 1 addition & 1 deletion requirements/mac-mps-cpu.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
diffusers==0.20.2
git+https://github.com/huggingface/diffusers.git@d1222064669a758c476014fb7a09e24a0c907222
invisible-watermark
transformers
accelerate
Expand Down
2 changes: 1 addition & 1 deletion requirements/win-dml.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
diffusers==0.20.2
git+https://github.com/huggingface/diffusers.git@d1222064669a758c476014fb7a09e24a0c907222
invisible-watermark
transformers
accelerate
Expand Down
2 changes: 1 addition & 1 deletion requirements/win-linux-cuda.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
diffusers==0.20.2
git+https://github.com/huggingface/diffusers.git@d1222064669a758c476014fb7a09e24a0c907222
invisible-watermark
transformers
accelerate
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = (0, 2, 0)
VERSION = (0, 3, 0)
def version_tag(version):
return f"{version[0]}.{version[1]}.{version[2]}"

Expand Down

0 comments on commit 4f210c5

Please sign in to comment.