diff --git a/__init__.py b/__init__.py index c601779c..7f906cff 100644 --- a/__init__.py +++ b/__init__.py @@ -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, 0, 9), + "version": (0, 1, 0), "location": "Image Editor -> Sidebar -> Dream", "category": "Paint" } @@ -65,10 +65,10 @@ def register(): bpy.types.Scene.dream_textures_requirements_path = EnumProperty(name="Platform", items=requirements_path_items, description="Specifies which set of dependencies to install", default='requirements/mac-mps-cpu.txt' if sys.platform == 'darwin' else 'requirements/win-linux-cuda.txt') - StableDiffusionPreferences.__annotations__['history'] = CollectionProperty(type=DreamPrompt) - for cls in PREFERENCE_CLASSES: bpy.utils.register_class(cls) + + bpy.types.Scene.dream_textures_history = CollectionProperty(type=DreamPrompt) check_for_updates() @@ -79,7 +79,7 @@ def register(): bpy.types.Scene.init_depth = PointerProperty(name="Init Depth", type=bpy.types.Image, description="Use an existing depth map. Leave blank to generate one from the init image") bpy.types.Scene.seamless_result = PointerProperty(type=SeamlessResult) def get_selection_preview(self): - history = bpy.context.preferences.addons[StableDiffusionPreferences.bl_idname].preferences.history + history = bpy.context.scene.dream_textures_history if self.dream_textures_history_selection > 0 and self.dream_textures_history_selection < len(history): return history[self.dream_textures_history_selection].generate_prompt() return "" diff --git a/builtin_presets/Debug.py b/builtin_presets/Debug.py index 13c2b176..3b90e853 100644 --- a/builtin_presets/Debug.py +++ b/builtin_presets/Debug.py @@ -1,10 +1,19 @@ import bpy prompt = bpy.context.scene.dream_textures_prompt -prompt.precision = 'auto' -prompt.random_seed = True -prompt.seed = '0' -prompt.steps = 25 +prompt.steps = 20 prompt.cfg_scale = 7.5 -prompt.sampler_name = 'k_lms' -prompt.show_steps = True +prompt.scheduler = 'DPM Solver Multistep' +prompt.step_preview_mode = 'Accurate' +prompt.optimizations_attention_slicing = True +prompt.optimizations_attention_slice_size_src = 'auto' +prompt.optimizations_attention_slice_size = 1 +prompt.optimizations_cudnn_benchmark = False +prompt.optimizations_tf32 = False +prompt.optimizations_amp = False +prompt.optimizations_half_precision = True +prompt.optimizations_sequential_cpu_offload = False +prompt.optimizations_channels_last_memory_format = False +prompt.optimizations_batch_size = 1 +prompt.optimizations_vae_slicing = True +prompt.optimizations_cpu_only = False diff --git a/builtin_presets/Final.py b/builtin_presets/Final.py index ac115714..339b7436 100644 --- a/builtin_presets/Final.py +++ b/builtin_presets/Final.py @@ -1,10 +1,19 @@ import bpy prompt = bpy.context.scene.dream_textures_prompt -prompt.precision = 'auto' -prompt.random_seed = True -prompt.seed = '0' prompt.steps = 50 prompt.cfg_scale = 7.5 -prompt.sampler_name = 'k_lms' -prompt.show_steps = False +prompt.scheduler = 'DPM Solver Multistep' +prompt.step_preview_mode = 'Fast' +prompt.optimizations_attention_slicing = True +prompt.optimizations_attention_slice_size_src = 'auto' +prompt.optimizations_attention_slice_size = 1 +prompt.optimizations_cudnn_benchmark = False +prompt.optimizations_tf32 = False +prompt.optimizations_amp = False +prompt.optimizations_half_precision = True +prompt.optimizations_sequential_cpu_offload = False +prompt.optimizations_channels_last_memory_format = False +prompt.optimizations_batch_size = 1 +prompt.optimizations_vae_slicing = True +prompt.optimizations_cpu_only = False diff --git a/builtin_presets/Preview.py b/builtin_presets/Preview.py index 9429241f..bf98d5e0 100644 --- a/builtin_presets/Preview.py +++ b/builtin_presets/Preview.py @@ -1,10 +1,19 @@ import bpy prompt = bpy.context.scene.dream_textures_prompt -prompt.precision = 'auto' -prompt.random_seed = True -prompt.seed = '0' -prompt.steps = 25 +prompt.steps = 20 prompt.cfg_scale = 7.5 -prompt.sampler_name = 'k_lms' -prompt.show_steps = False \ No newline at end of file +prompt.scheduler = 'DPM Solver Multistep' +prompt.step_preview_mode = 'Fast' +prompt.optimizations_attention_slicing = True +prompt.optimizations_attention_slice_size_src = 'auto' +prompt.optimizations_attention_slice_size = 1 +prompt.optimizations_cudnn_benchmark = False +prompt.optimizations_tf32 = False +prompt.optimizations_amp = False +prompt.optimizations_half_precision = True +prompt.optimizations_sequential_cpu_offload = False +prompt.optimizations_channels_last_memory_format = False +prompt.optimizations_batch_size = 1 +prompt.optimizations_vae_slicing = True +prompt.optimizations_cpu_only = False diff --git a/generator_process/actions/prompt_to_image.py b/generator_process/actions/prompt_to_image.py index 13c5c2a7..bce36d1b 100644 --- a/generator_process/actions/prompt_to_image.py +++ b/generator_process/actions/prompt_to_image.py @@ -2,6 +2,7 @@ import enum import math import os +import sys from dataclasses import dataclass from contextlib import nullcontext @@ -155,6 +156,15 @@ class Optimizations: cpu_only: bool = False + @staticmethod + def infer_device() -> str: + if sys.platform == "darwin": + return "mps" + elif Pipeline.directml_available(): + return "privateuseone" + else: + return "cuda" + def can_use(self, property, device) -> bool: if not getattr(self, property): return False diff --git a/operators/dream_texture.py b/operators/dream_texture.py index dd6f45f3..792f3d8c 100644 --- a/operators/dream_texture.py +++ b/operators/dream_texture.py @@ -133,7 +133,7 @@ def done_callback(future): image_hash = hashlib.sha256((np.array(image.pixels) * 255).tobytes()).hexdigest() image['dream_textures_hash'] = image_hash scene.dream_textures_prompt.hash = image_hash - history_entry = context.preferences.addons[StableDiffusionPreferences.bl_idname].preferences.history.add() + history_entry = context.scene.dream_textures_history.add() for key, value in history_template.items(): setattr(history_entry, key, value) history_entry.seed = str(seed) @@ -174,7 +174,7 @@ def generate_next(): match generated_args['init_img_action']: case 'modify': models = list(filter( - lambda m: m.model == generated_args['model'], + lambda m: m.model_base == generated_args['model'], context.preferences.addons[StableDiffusionPreferences.bl_idname].preferences.installed_models )) supports_depth = generated_args['pipeline'].depth() and len(models) > 0 and ModelType[models[0].model_type] == ModelType.DEPTH diff --git a/operators/open_latest_version.py b/operators/open_latest_version.py index 0aa56abd..dd5892f7 100644 --- a/operators/open_latest_version.py +++ b/operators/open_latest_version.py @@ -1,5 +1,4 @@ import requests -import json import bpy import webbrowser from ..version import VERSION, version_tag, version_tuple @@ -34,7 +33,7 @@ class OpenLatestVersion(bpy.types.Operator): bl_options = {"REGISTER", "INTERNAL"} @classmethod - def poll(self, context): + def poll(cls, context): return True def execute(self, context): diff --git a/operators/project.py b/operators/project.py index a3e3f073..ce3e0c99 100644 --- a/operators/project.py +++ b/operators/project.py @@ -26,6 +26,43 @@ ('color', 'Depth and Color', 'Provide the scene depth and color as input'), ] +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' + raise FixItError( + """No objects selected +Select at least one object to project onto.""", + fix_selection + ) + 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' + raise FixItError( + """Enter edit mode +In edit mode, select the faces to project onto.""", + fix_mode + ) + has_selection = False + for obj in context.selected_objects: + if not hasattr(obj, "data"): + continue + mesh = bmesh.from_edit_mesh(obj.data) + bm = mesh.copy() + bm.select_mode = {'FACE'} + for f in bm.faces: + if f.select: + has_selection = True + break + if not has_selection: + raise FixItError( + """No faces selected. +Select at least one face to project onto.""", + lambda ctx, layout: None + ) + def dream_texture_projection_panels(): class DREAM_PT_dream_panel_projection(bpy.types.Panel): """Creates a Dream Textures panel for projection""" @@ -51,15 +88,16 @@ def draw(self, context): layout = self.layout layout.use_property_split = True layout.use_property_decorate = False + + if is_force_show_download(): + layout.operator(OpenLatestVersion.bl_idname, icon="IMPORT", text="Download Latest Release") + elif new_version_available(): + layout.operator(OpenLatestVersion.bl_idname, icon="IMPORT") layout.prop(context.scene.dream_textures_project_prompt, "pipeline") if Pipeline[context.scene.dream_textures_project_prompt.pipeline].model(): layout.prop(context.scene.dream_textures_project_prompt, 'model') - if is_force_show_download(): - layout.operator(OpenLatestVersion.bl_idname, icon="IMPORT", text="Download Latest Release") - elif new_version_available(): - layout.operator(OpenLatestVersion.bl_idname, icon="IMPORT") yield DREAM_PT_dream_panel_projection @@ -101,10 +139,6 @@ def draw(self, context): r = row.row() r.operator(ProjectDreamTexture.bl_idname, icon="MOD_UVPROJECT") r.enabled = Pipeline[context.scene.dream_textures_project_prompt.pipeline].depth() and context.object is not None and context.object.mode == 'EDIT' - if context.object is not None and context.object.mode != 'EDIT': - box = layout.box() - box.label(text="Enter Edit Mode", icon="ERROR") - box.label(text="In edit mode, select the faces to project onto.") else: disabled_row = row.row() disabled_row.use_property_split = True @@ -117,6 +151,7 @@ def draw(self, context): # Validation try: prompt.validate(context, task=ModelType.DEPTH) + _validate_projection(context) except FixItError as e: error_box = layout.box() error_box.use_property_split = False @@ -224,6 +259,7 @@ class ProjectDreamTexture(bpy.types.Operator): def poll(cls, context): try: context.scene.dream_textures_project_prompt.validate(context, task=ModelType.DEPTH) + _validate_projection(context) except: return False return Generator.shared().can_use() @@ -313,6 +349,7 @@ def vert_to_uv(v): uv_layer, uv_layer_index = ProjectDreamTexture.get_uv_layer(mesh) bm = mesh.copy() + bm.select_mode = {'FACE'} bmesh.ops.split_edges(bm, edges=bm.edges) bmesh.ops.delete(bm, geom=[f for f in bm.faces if not f.select], context='FACES') target_objects.append((bm, bm.loops.layers.uv[uv_layer_index])) diff --git a/operators/view_history.py b/operators/view_history.py index a364dd6d..f86a3bff 100644 --- a/operators/view_history.py +++ b/operators/view_history.py @@ -2,24 +2,17 @@ from bpy_extras.io_utils import ImportHelper, ExportHelper import json import os -from ..property_groups.dream_prompt import scheduler_options +from ..property_groups.dream_prompt import DreamPrompt, scheduler_options from ..preferences import StableDiffusionPreferences class SCENE_UL_HistoryList(bpy.types.UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname): if self.layout_type in {'DEFAULT', 'COMPACT'}: - if item.prompt_structure_token_subject == "SCENE_UL_HistoryList_header": - layout.label(text="Subject") - layout.label(text="Seed") - layout.label(text="Size") - layout.label(text="Steps") - layout.label(text="Sampler") - else: - layout.label(text=item.get_prompt_subject(), translate=False, icon_value=icon) - layout.label(text=f"{item.seed}", translate=False) - layout.label(text=f"{item.width}x{item.height}", translate=False) - layout.label(text=f"{item.steps} steps", translate=False) - layout.label(text=next(x for x in scheduler_options if x[0] == item.scheduler)[1], translate=False) + layout.label(text=item.get_prompt_subject(), translate=False, icon_value=icon) + layout.label(text=f"{item.seed}", translate=False) + layout.label(text=f"{item.width}x{item.height}", translate=False) + layout.label(text=f"{item.steps} steps", translate=False) + layout.label(text=next(x for x in scheduler_options if x[0] == item.scheduler)[1], translate=False) elif self.layout_type == 'GRID': layout.alignment = 'CENTER' layout.label(text="", icon_value=icon) @@ -32,10 +25,10 @@ class RecallHistoryEntry(bpy.types.Operator): @classmethod def poll(self, context): - return context.scene.dream_textures_history_selection is not None and context.scene.dream_textures_history_selection > 0 + return context.scene.dream_textures_history_selection is not None def execute(self, context): - selection = context.preferences.addons[StableDiffusionPreferences.bl_idname].preferences.history[context.scene.dream_textures_history_selection] + selection = context.scene.dream_textures_history[context.scene.dream_textures_history_selection] for prop in selection.__annotations__.keys(): if hasattr(context.scene.dream_textures_prompt, prop): setattr(context.scene.dream_textures_prompt, prop, getattr(selection, prop)) @@ -64,7 +57,7 @@ class ClearHistory(bpy.types.Operator): bl_options = {'REGISTER'} def execute(self, context): - context.preferences.addons[StableDiffusionPreferences.bl_idname].preferences.history.clear() + context.scene.dream_textures_history.clear() return {"FINISHED"} @@ -76,10 +69,10 @@ class RemoveHistorySelection(bpy.types.Operator): @classmethod def poll(self, context): - return context.scene.dream_textures_history_selection is not None and context.scene.dream_textures_history_selection > 0 + return context.scene.dream_textures_history_selection is not None def execute(self, context): - context.preferences.addons[StableDiffusionPreferences.bl_idname].preferences.history.remove(context.scene.dream_textures_history_selection) + context.scene.dream_textures_history.remove(context.scene.dream_textures_history_selection) return {"FINISHED"} @@ -98,22 +91,22 @@ class ExportHistorySelection(bpy.types.Operator, ExportHelper): @classmethod def poll(self, context): - return context.scene.dream_textures_history_selection is not None and context.scene.dream_textures_history_selection > 0 + return context.scene.dream_textures_history_selection is not None def invoke(self, context, event): - selection = context.preferences.addons[StableDiffusionPreferences.bl_idname].preferences.history[context.scene.dream_textures_history_selection] + selection = context.scene.dream_textures_history[context.scene.dream_textures_history_selection] self.filepath = "untitled" if selection is None else selection.get_prompt_subject() context.window_manager.fileselect_add(self) return {'RUNNING_MODAL'} def execute(self, context): - selection = context.preferences.addons[StableDiffusionPreferences.bl_idname].preferences.history[context.scene.dream_textures_history_selection] + selection = context.scene.dream_textures_history[context.scene.dream_textures_history_selection] if selection is None: self.report({"ERROR"}, "No valid selection to export.") return {"FINISHED"} with open(self.filepath, 'w', encoding='utf-8') as target: - args = selection.generate_args() - args['seed'] = selection.seed + args = {key: getattr(selection, key) for key in DreamPrompt.__annotations__} + args["outpaint_origin"] = list(args["outpaint_origin"]) json.dump(args, target, indent=4) return {"FINISHED"} diff --git a/preferences.py b/preferences.py index 6279b32a..cf17d6c1 100644 --- a/preferences.py +++ b/preferences.py @@ -65,6 +65,7 @@ class Model(bpy.types.PropertyGroup): bl_idname = "dream_textures.Model" model: bpy.props.StringProperty(name="Model") + model_base: bpy.props.StringProperty() downloads: bpy.props.IntProperty(name="Downloads") likes: bpy.props.IntProperty(name="Likes") model_type: bpy.props.EnumProperty(name="Model Type", items=[(t.name, t.name, '') for t in ModelType]) @@ -94,6 +95,7 @@ def set_model_list(model_list: str, models: list): for model in models: m = getattr(bpy.context.preferences.addons[__package__].preferences, model_list).add() m.model = model.id + m.model_base = os.path.basename(model.id) m.downloads = model.downloads m.likes = model.likes try: diff --git a/property_groups/dream_prompt.py b/property_groups/dream_prompt.py index 9499a590..62261683 100644 --- a/property_groups/dream_prompt.py +++ b/property_groups/dream_prompt.py @@ -69,8 +69,8 @@ def model_options(self, context): case Pipeline.STABLE_DIFFUSION: def model_case(model, i): return ( - model.model, - os.path.basename(model.model).replace('models--', '').replace('--', '/'), + model.model_base, + model.model_base.replace('models--', '').replace('--', '/'), ModelType[model.model_type].name, i ) @@ -140,7 +140,7 @@ def seed_clamp(self, ctx): "iterations": IntProperty(name="Iterations", default=1, min=1, description="How many images to generate"), "steps": IntProperty(name="Steps", default=25, min=1), "cfg_scale": FloatProperty(name="CFG Scale", default=7.5, min=1, soft_min=1.01, description="How strongly the prompt influences the image"), - "scheduler": EnumProperty(name="Scheduler", items=scheduler_options, default=0), + "scheduler": EnumProperty(name="Scheduler", items=scheduler_options, default=3), # defaults to "DPM Solver Multistep" "step_preview_mode": EnumProperty(name="Step Preview", description="Displays intermediate steps in the Image Viewer. Disabling can speed up generation", items=step_preview_mode_options, default=1), # Init Image @@ -166,12 +166,7 @@ def seed_clamp(self, ctx): } default_optimizations = Optimizations() -if sys.platform == "darwin": - inferred_device = "mps" -elif Pipeline.directml_available(): - inferred_device = "privateuseone" -else: - inferred_device = "cuda" + for optim in dir(Optimizations): if optim.startswith('_'): continue @@ -183,8 +178,7 @@ def seed_clamp(self, ctx): if default is not None and not isinstance(getattr(default_optimizations, optim), bool): continue setattr(default_optimizations, optim, True) - if default_optimizations.can_use(optim, inferred_device): - attributes[f"optimizations_{optim}"] = BoolProperty(name=optim.replace('_', ' ').title(), default=default) + attributes[f"optimizations_{optim}"] = BoolProperty(name=optim.replace('_', ' ').title(), default=default) attributes["optimizations_attention_slice_size_src"] = EnumProperty(name="Attention Slice Size", items=( ("auto", "Automatic", "", 1), ("manual", "Manual", "", 2), diff --git a/property_groups/dream_prompt_validation.py b/property_groups/dream_prompt_validation.py index 15ee523b..15a5b633 100644 --- a/property_groups/dream_prompt_validation.py +++ b/property_groups/dream_prompt_validation.py @@ -39,7 +39,7 @@ def validate(self, context, task: ModelType | None = None) -> bool: ) installed_models = context.preferences.addons[StableDiffusionPreferences.bl_idname].preferences.installed_models - model = next((m for m in installed_models if m.model == self.model), None) + model = next((m for m in installed_models if m.model_base == self.model), None) if model is None: raise FixItError("No model selected.", lambda _, layout: layout.prop(self, "model")) else: diff --git a/property_groups/seamless_result.py b/property_groups/seamless_result.py index 5ca1e7b1..f93fc258 100644 --- a/property_groups/seamless_result.py +++ b/property_groups/seamless_result.py @@ -29,7 +29,7 @@ def check(self, image): def hash_init(): self.image = image self.result = res - for args in bpy.context.preferences.addons[StableDiffusionPreferences.bl_idname].preferences.history: + for args in bpy.context.scene.dream_textures_history: if args.get('hash', None) == hash_string and args.seamless_axes != SeamlessAxes.AUTO: res = SeamlessAxes(args.seamless_axes).text bpy.app.timers.register(hash_init) diff --git a/ui/panels/dream_texture.py b/ui/panels/dream_texture.py index 3678be92..bfd67725 100644 --- a/ui/panels/dream_texture.py +++ b/ui/panels/dream_texture.py @@ -14,6 +14,7 @@ from ...operators.view_history import ImportPromptFile from ..space_types import SPACE_TYPES from ...property_groups.dream_prompt import DreamPrompt, pipeline_options +from ...generator_process.actions.prompt_to_image import Optimizations from ...generator_process.actions.detect_seamless import SeamlessAxes from ...generator_process.models import Pipeline, FixItError @@ -44,15 +45,15 @@ def draw(self, context): layout.use_property_split = True layout.use_property_decorate = False - layout.prop(context.scene.dream_textures_prompt, "pipeline") - if Pipeline[context.scene.dream_textures_prompt.pipeline].model(): - layout.prop(context.scene.dream_textures_prompt, 'model') - if is_force_show_download(): layout.operator(OpenLatestVersion.bl_idname, icon="IMPORT", text="Download Latest Release") elif new_version_available(): layout.operator(OpenLatestVersion.bl_idname, icon="IMPORT") + layout.prop(context.scene.dream_textures_prompt, "pipeline") + if Pipeline[context.scene.dream_textures_prompt.pipeline].model(): + layout.prop(context.scene.dream_textures_prompt, 'model') + DreamTexturePanel.__name__ = f"DREAM_PT_dream_panel_{space_type}" yield DreamTexturePanel @@ -273,9 +274,11 @@ def draw(self, context): layout.use_property_split = True prompt = get_prompt(context) + inferred_device = Optimizations.infer_device() def optimization(prop): if hasattr(prompt, f"optimizations_{prop}"): - layout.prop(prompt, f"optimizations_{prop}") + if Optimizations().can_use(prop, inferred_device): + layout.prop(prompt, f"optimizations_{prop}") optimization("cudnn_benchmark") optimization("tf32") diff --git a/ui/panels/history.py b/ui/panels/history.py index 58a34e68..a475e36a 100644 --- a/ui/panels/history.py +++ b/ui/panels/history.py @@ -19,20 +19,14 @@ class HistoryPanel(Panel): bl_region_type = 'UI' @classmethod - def poll(self, context): - if self.bl_space_type == 'NODE_EDITOR': + def poll(cls, context): + if cls.bl_space_type == 'NODE_EDITOR': return context.area.ui_type == "ShaderNodeTree" or context.area.ui_type == "CompositorNodeTree" else: return True def draw(self, context): - history = context.preferences.addons[StableDiffusionPreferences.bl_idname].preferences.history - if len(history) < 1: - header = history.add() - else: - header = history[0] - header.prompt_structure_token_subject = "SCENE_UL_HistoryList_header" - self.layout.template_list("SCENE_UL_HistoryList", "", context.preferences.addons[StableDiffusionPreferences.bl_idname].preferences, "history", context.scene, "dream_textures_history_selection") + self.layout.template_list("SCENE_UL_HistoryList", "", context.scene, "dream_textures_history", context.scene, "dream_textures_history_selection") row = self.layout.row() row.prop(context.scene, "dream_textures_history_selection_preview") diff --git a/ui/panels/render_properties.py b/ui/panels/render_properties.py index b1b6080b..731f9b69 100644 --- a/ui/panels/render_properties.py +++ b/ui/panels/render_properties.py @@ -47,7 +47,7 @@ def draw(self, context): box.label(text="The selected pipeline does not support depth to image.") models = list(filter( - lambda m: m.model == context.scene.dream_textures_render_properties_prompt.model, + lambda m: m.model_base == context.scene.dream_textures_render_properties_prompt.model, context.preferences.addons[StableDiffusionPreferences.bl_idname].preferences.installed_models )) if len(models) > 0 and ModelType[models[0].model_type] != ModelType.DEPTH: diff --git a/ui/presets.py b/ui/presets.py index 8aac830a..54b432f3 100644 --- a/ui/presets.py +++ b/ui/presets.py @@ -2,20 +2,15 @@ from bpy.types import Panel, Operator, Menu from bl_operators.presets import AddPresetBase from bl_ui.utils import PresetPanel +from typing import _AnnotatedAlias import os import shutil from ..absolute_path import absolute_path +from ..generator_process.actions.prompt_to_image import Optimizations class DreamTexturesPresetPanel(PresetPanel, Panel): preset_operator = "script.execute_preset" - # @staticmethod - # def post_cb(context): - # # Modify an arbitrary built-in scene property to force a depsgraph - # # update, because add-on properties don't. (see T62325) - # render = context.scene.render - # render.filter_size = render.filter_size - class DREAM_PT_AdvancedPresets(DreamTexturesPresetPanel): bl_label = "Advanced Presets" preset_subdir = "dream_textures/advanced" @@ -36,13 +31,23 @@ class AddAdvancedPreset(AddPresetBase, Operator): preset_defines = ['prompt = bpy.context.scene.dream_textures_prompt'] preset_values = [ - "prompt.precision", - "prompt.random_seed", - "prompt.seed", "prompt.steps", "prompt.cfg_scale", "prompt.scheduler", - "prompt.show_steps", + "prompt.step_preview_mode", + + "prompt.optimizations_attention_slicing", + "prompt.optimizations_attention_slice_size_src", + "prompt.optimizations_attention_slice_size", + "prompt.optimizations_cudnn_benchmark", + "prompt.optimizations_tf32", + "prompt.optimizations_amp", + "prompt.optimizations_half_precision", + "prompt.optimizations_sequential_cpu_offload", + "prompt.optimizations_channels_last_memory_format", + "prompt.optimizations_batch_size", + "prompt.optimizations_vae_slicing", + "prompt.optimizations_cpu_only", ] class RestoreDefaultPresets(Operator): diff --git a/version.py b/version.py index 32d8a1ab..7ebd6c31 100644 --- a/version.py +++ b/version.py @@ -1,4 +1,4 @@ -VERSION = (0, 0, 9) +VERSION = (0, 1, 0) def version_tag(version): return f"{version[0]}.{version[1]}.{version[2]}"