Skip to content

Transform your 3D texturing workflow with the power of generative AI, directly within Blender!

refactor preserve existing textures into a brand new local edit mode, remove now useless bake while generating

sakalond69578d56045e
diff --git a/.gitignore b/.gitignore
index 04f7719..8fdddc2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -173,3 +173,4 @@ cython_debug/
# PyPI configuration file
.pypirc
stablegen/feather.oso
+stablegen.zip
diff --git a/stablegen/__init__.py b/stablegen/__init__.py
index c7a5737..0187b69 100644
--- a/stablegen/__init__.py
+++ b/stablegen/__init__.py
@@ -1369,7 +1369,8 @@ def register():
('separate', 'Generate Separately', 'Generates images one by one for each viewpoint. Each image is generated independently using only its own control signals (e.g., depth map) without context from other views. All images are applied at the end.'),
('sequential', 'Generate Sequentially', 'Generates images viewpoint by viewpoint. After the first view, each subsequent view is generated using inpainting, guided by a visibility mask and an RGB render of the texture projected from previous viewpoints to maintain consistency.'),
('grid', 'Generate Using Grid', 'Combines control signals from all viewpoints into a single grid, generates a single image, then splits it back into individual viewpoint textures. Faster but lower resolution per view. Includes an optional second pass to refine each split image individually at full resolution for improved quality.'),
- ('refine', 'Refine/Restyle Texture (Img2Img)', 'Uses the current rendered texture appearance as input for an img2img generation pass.\n\nBehavior depends on "Preserve Original Textures" (Advanced Parameters -> Generation Mode Specifics):\n\nON: Layers new details over the existing texture (preserves uncovered areas).\n - Works only with StableGen generated textures.\n\nOFF: Replaces the previous material with the new result (good for restyling).\n - Works on any existing material setup.'),
+ ('refine', 'Refine/Restyle Texture (Img2Img)', 'Uses the current rendered texture appearance as input for an img2img generation pass. Replaces the previous material with the new result. Good for restyling or globally changing the look of an existing texture. Works on any existing material setup.'),
+ ('local_edit', 'Local Edit', 'Make localized changes to an existing texture. Point cameras at areas you want to modify — the new generation blends over the original using angle and vignette-based feathering, preserving untouched areas. Works only with StableGen generated textures.'),
('uv_inpaint', 'UV Inpaint Missing Areas', 'Identifies untextured areas on a standard UV map using a visibility calculation. Performs baking if not baked already. Performs diffusion inpainting directly on the UV texture map to fill only these missing regions, using the surrounding texture as context.'),
],
default='sequential',
@@ -1380,7 +1381,8 @@ def register():
description="Choose the mode for generating images with Qwen",
items=[
('generate', 'Generate', 'Standard generation mode'),
- ('refine', 'Refine', 'Refine existing image'),
+ ('refine', 'Refine', 'Refine/restyle the entire texture using Qwen Image Edit. Replaces the existing material with the new result. Describe the desired look in the prompt — you can completely change the style, color scheme, or overall appearance.'),
+ ('local_edit', 'Local Edit', 'Make targeted changes to specific areas of the texture. Point cameras at what you want to change and describe the edit — you can change colors, add details, sharpen, alter text, or restyle selected parts. Untouched areas are preserved.'),
],
default='generate',
update=update_parameters
@@ -1498,12 +1500,6 @@ def register():
default=True,
update=update_parameters
)
- bpy.types.Scene.refine_preserve = bpy.props.BoolProperty(
- name="Preserve Original Texture",
- description="Preserve the original textures when refining in places where the new texture isn't available",
- default=False,
- update=update_parameters
- )
bpy.types.Scene.discard_factor = bpy.props.FloatProperty(
name="Discard Factor",
description="If the texture is facing the camera at an angle greater than this value, it will be discarded. This is useful for preventing artifacts from the very edge of the generated texture appearing when keeping high discard factor (use ~65 for best results when generating textures around an object)",
@@ -1565,39 +1561,6 @@ def register():
max=1000.0,
update=update_parameters
)
- bpy.types.Scene.bake_texture = bpy.props.BoolProperty(
- name="Bake Texture",
- description="Bake the texture to the model. This is forced if there are more than 8 cameras. Use this to prevent UV map slot limit errors.",
- default=False,
- update=update_parameters
- )
- bpy.types.Scene.bake_texture_size = bpy.props.IntProperty(
- name="Bake Texture Size",
- description="Size of the baked texture",
- default=2048,
- min=256,
- max=8192,
- update=update_parameters
- )
- bpy.types.Scene.bake_unwrap_method = bpy.props.EnumProperty(
- name="Bake Unwrap Method",
- description="Method for unwrapping the model for baking",
- items=[
- ('none', 'None', ''),
- ('smart', 'Smart UV Project', ''),
- ('basic', 'Unwrap', ''),
- ('lightmap', 'Lightmap Pack', ''),
- ('pack', 'Pack Islands', '')
- ],
- default='none',
- update=update_parameters
- )
- bpy.types.Scene.bake_unwrap_overlap_only = bpy.props.BoolProperty(
- name="Ony Unwrap Overlapping UVs",
- description="Only unwrap UVs that overlap",
- default=True,
- update=update_parameters
- )
bpy.types.Scene.allow_modify_existing_textures = bpy.props.BoolProperty(
name="Allow modifying existing textures",
description="Disconnect compare node in export_visibility so that smooth output is not pure 1 areas",
@@ -1712,7 +1675,7 @@ def register():
bpy.types.Scene.visibility_vignette_softness = bpy.props.FloatProperty(
name="Vignette Softness",
description="Exponent shaping feather falloff (<1 = softer, >1 = sharper)",
- default=1.0,
+ default=0.5,
min=0.1,
max=5.0,
update=update_parameters,
@@ -2140,15 +2103,10 @@ def unregister():
del bpy.types.Scene.generation_status
del bpy.types.Scene.generation_progress
del bpy.types.Scene.overwrite_material
- del bpy.types.Scene.refine_preserve
del bpy.types.Scene.discard_factor
del bpy.types.Scene.discard_factor_generation_only
del bpy.types.Scene.discard_factor_after_generation
del bpy.types.Scene.weight_exponent
- del bpy.types.Scene.bake_texture
- del bpy.types.Scene.bake_texture_size
- del bpy.types.Scene.bake_unwrap_method
- del bpy.types.Scene.bake_unwrap_overlap_only
del bpy.types.Scene.allow_modify_existing_textures
del bpy.types.Scene.ask_object_prompts
del bpy.types.Scene.fallback_color
diff --git a/stablegen/generator.py b/stablegen/generator.py
index b964051..24c91c5 100644
--- a/stablegen/generator.py
+++ b/stablegen/generator.py
@@ -543,7 +543,7 @@ class ComfyUIGenerate(bpy.types.Operator):
ComfyUIGenerate._is_running = False
return {'CANCELLED'}
- if not context.scene.overwrite_material or self._material_id == -1 or ((context.scene.generation_method == 'refine' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'refine')) and context.scene.refine_preserve):
+ if not context.scene.overwrite_material or self._material_id == -1 or (context.scene.generation_method == 'local_edit' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'local_edit')):
self._material_id += 1
if context.scene.generation_method == 'sequential' and context.scene.sequential_custom_camera_order != "":
@@ -571,7 +571,7 @@ class ComfyUIGenerate(bpy.types.Operator):
if context.scene.generation_mode == 'standard' or context.scene.generation_mode == 'regenerate_selected':
# If there is depth controlnet unit
- if any(unit["unit_type"] == "depth" for unit in controlnet_units) or (context.scene.use_flux_lora and context.scene.model_architecture == 'flux1') or (context.scene.model_architecture == 'qwen_image_edit' and context.scene.qwen_guidance_map_type == 'depth') or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'refine' and context.scene.qwen_refine_use_depth):
+ if any(unit["unit_type"] == "depth" for unit in controlnet_units) or (context.scene.use_flux_lora and context.scene.model_architecture == 'flux1') or (context.scene.model_architecture == 'qwen_image_edit' and context.scene.qwen_guidance_map_type == 'depth') or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method in ('refine', 'local_edit') and context.scene.qwen_refine_use_depth):
if context.scene.generation_method != 'uv_inpaint':
# Export depth maps for each camera
for i, camera in enumerate(self._cameras):
@@ -639,8 +639,8 @@ class ComfyUIGenerate(bpy.types.Operator):
self._original_visibility[obj.name] = obj.hide_render
obj.hide_render = True
- # Refine mode preparation
- if context.scene.generation_method == 'refine' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'refine'):
+ # Refine/Local Edit mode preparation
+ if context.scene.generation_method in ('refine', 'local_edit') or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method in ('refine', 'local_edit')):
for i, camera in enumerate(self._cameras):
bpy.context.scene.camera = camera
export_emit_image(context, self._to_texture, camera_id=i)
@@ -894,7 +894,7 @@ class ComfyUIGenerate(bpy.types.Operator):
render_info = self._get_uploaded_image_info(context, "baked", object_name=current_obj_name)
# Get info for refine/sequential render/mask inputs
- if context.scene.generation_method == 'refine':
+ if context.scene.generation_method in ('refine', 'local_edit'):
render_info = self._get_uploaded_image_info(context, "inpaint", subtype="render", camera_id=camera_id)
elif context.scene.generation_method == 'sequential' and self._current_image > 0:
render_info = self._get_uploaded_image_info(context, "inpaint", subtype="render", camera_id=self._current_image)
@@ -912,7 +912,7 @@ class ComfyUIGenerate(bpy.types.Operator):
# End Prepare Image Info
# Generate image without ControlNet if needed
- if context.scene.generation_mode == 'standard' and camera_id == 0 and (context.scene.generation_method == 'sequential' or context.scene.generation_method == 'refine')\
+ if context.scene.generation_mode == 'standard' and camera_id == 0 and (context.scene.generation_method == 'sequential' or context.scene.generation_method in ('refine', 'local_edit'))\
and context.scene.sequential_ipadapter and context.scene.sequential_ipadapter_regenerate and not context.scene.use_ipadapter and context.scene.sequential_ipadapter_mode == 'first':
self._stage = "Generating Reference Image"
# Don't use ControlNet for the first image if sequential_ipadapter_regenerate_wo_controlnet is enabled
@@ -925,12 +925,12 @@ class ComfyUIGenerate(bpy.types.Operator):
self._progress = 0
# Generate the image
- if context.scene.generation_method == 'refine':
+ if context.scene.generation_method in ('refine', 'local_edit'):
if context.scene.model_architecture == 'flux1':
image = self.workflow_manager.refine_flux(context, controlnet_info=controlnet_info, render_info=render_info, ipadapter_ref_info=ipadapter_ref_info)
else:
image = self.workflow_manager.refine(context, controlnet_info=controlnet_info, render_info=render_info, ipadapter_ref_info=ipadapter_ref_info)
- elif context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'refine':
+ elif context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method in ('refine', 'local_edit'):
image = self.workflow_manager.generate_qwen_refine(context, camera_id=camera_id)
elif context.scene.generation_method == 'uv_inpaint':
if context.scene.model_architecture == 'flux1':
@@ -1007,7 +1007,7 @@ class ComfyUIGenerate(bpy.types.Operator):
# Use hack to re-generate the image using IPAdapter to match IPAdapter style
- if camera_id == 0 and (context.scene.generation_method == 'sequential' or context.scene.generation_method == 'separate' or context.scene.generation_method == 'refine')\
+ if camera_id == 0 and (context.scene.generation_method == 'sequential' or context.scene.generation_method == 'separate' or context.scene.generation_method in ('refine', 'local_edit'))\
and context.scene.sequential_ipadapter and context.scene.sequential_ipadapter_regenerate and not context.scene.use_ipadapter and context.scene.sequential_ipadapter_mode == 'first':
# Restore original strengths
@@ -1019,12 +1019,12 @@ class ComfyUIGenerate(bpy.types.Operator):
context.scene.ipadapter_image = image_path
ipadapter_ref_info = self._get_uploaded_image_info(context, "custom", filename=image_path)
if context.scene.model_architecture == "sdxl":
- if context.scene.generation_method == "refine":
+ if context.scene.generation_method in ("refine", "local_edit"):
image = self.workflow_manager.refine(context, controlnet_info=controlnet_info, render_info=render_info, mask_info=mask_info, ipadapter_ref_info=ipadapter_ref_info)
else:
image = self.workflow_manager.generate(context, controlnet_info=controlnet_info, ipadapter_ref_info=ipadapter_ref_info)
elif context.scene.model_architecture == "flux1":
- if context.scene.generation_method == "refine":
+ if context.scene.generation_method in ("refine", "local_edit"):
image = self.workflow_manager.refine_flux(context, controlnet_info=controlnet_info, render_info=render_info, mask_info=mask_info, ipadapter_ref_info=ipadapter_ref_info)
else:
image = self.workflow_manager.generate_flux(context, controlnet_info=controlnet_info, ipadapter_ref_info=ipadapter_ref_info)
@@ -1058,7 +1058,7 @@ class ComfyUIGenerate(bpy.types.Operator):
else: # steps == 0, skip generation
pass # No image generation needed
- if context.scene.generation_method == 'separate' or context.scene.generation_method == 'refine' or context.scene.generation_method == 'sequential' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'refine'):
+ if context.scene.generation_method in ('separate', 'refine', 'local_edit', 'sequential') or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method in ('refine', 'local_edit')):
self._current_image += 1
self._threads_left -= 1
if self._threads_left > 0:
@@ -1111,8 +1111,6 @@ class ComfyUIGenerate(bpy.types.Operator):
if context.scene.generation_method == 'sequential':
return None
self._stage = "Projecting Image"
- if context.scene.bake_texture:
- self._stage = "Baking Textures & Projecting"
redraw_ui(context)
if context.scene.generation_method != 'uv_inpaint':
project_image(context, self._to_texture, self._material_id)
diff --git a/stablegen/project.py b/stablegen/project.py
index c8e991e..bf5743e 100644
--- a/stablegen/project.py
+++ b/stablegen/project.py
@@ -556,7 +556,8 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
A tuple (final_shader, final_weight_node).
"""
# Compute offsets based on recursion level
- if context.scene.refine_preserve:
+ is_local_edit = (context.scene.generation_method == 'local_edit' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'local_edit'))
+ if is_local_edit:
last_node_x = last_node.location[0] if last_node else 0
x_offset = 1000 + level * 800 + last_node_x + 200 if context.scene.early_priority else 1000 + level * 600 + last_node_x + 200
else:
@@ -575,7 +576,7 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
links.new(last_node.outputs[0], final_mix.inputs["Color2"])
# Create a compare node to drive the mix factor
- if (context.scene.generation_method == 'refine' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'refine')) and context.scene.refine_preserve:
+ if is_local_edit:
w_node = weight_nodes[0]
if isinstance(w_node, tuple):
angle_node, feather_node = w_node
@@ -621,7 +622,7 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
# Fallback if not tuple (e.g. stop_index logic used LessThan node)
# If it's a sum of processed weights (from multi-camera recursion), we need to invert it
# to get the Mix Factor (1 - TotalVis)
- if (context.scene.generation_method == 'refine' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'refine')) and context.scene.refine_preserve:
+ if is_local_edit:
invert = nodes_collection.new("ShaderNodeMath")
invert.operation = 'SUBTRACT'
invert.location = (x_offset - 150, y_offset)
@@ -649,7 +650,7 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
# Add a principle shader for the mixed color
should_add_principled = True
- if (context.scene.generation_method == 'refine' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'refine')) and context.scene.refine_preserve:
+ if is_local_edit:
# Final principled is at last_node's output if it is BSDF
final_principled = last_node.outputs[0].links[0].to_node
if final_principled.type == 'BSDF_PRINCIPLED':
@@ -764,7 +765,7 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
for i, camera in enumerate(cameras):
for x, obj in enumerate(to_project):
# We can skip the UV Projection step in sequential mode for i > 0
- if context.scene.generation_method != 'sequential' or stop_index == 0 or context.scene.bake_texture:
+ if context.scene.generation_method != 'sequential' or stop_index == 0:
# Deselect all objects
bpy.ops.object.select_all(action='DESELECT')
# Select object as active (needed for applying the modifier)
@@ -791,11 +792,6 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
if not buffer_uv:
buffer_uv = obj.data.uv_layers.new(name=_SG_BUFFER_UV_NAME)
- # If the object has no UV map other than the buffer and we are baking, create one
- non_buffer_uvs = [uv for uv in obj.data.uv_layers if uv.name != _SG_BUFFER_UV_NAME]
- if not non_buffer_uvs and context.scene.bake_texture:
- obj.data.uv_layers.new(name="BakeUV")
-
# Add the UV Project Modifier
uv_project_mod = obj.modifiers.new(name="UVProject", type='UV_PROJECT')
@@ -831,21 +827,6 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
original_uv_map = obj.data.uv_layers[1]
obj.data.uv_layers.active = original_uv_map
- # If we are running in sequential mode, we already have baked textures for i < stop_index
- if context.scene.bake_texture:
- if (stop_index > 0 and context.scene.generation_method == 'sequential'):
- # Deselect all objects
- bpy.ops.object.select_all(action='DESELECT')
- # Select object as active (needed for applying the modifier)
- context.view_layer.objects.active = obj
- obj.select_set(True)
- if i <= stop_index and (not context.scene.generation_method == 'sequential' or i == stop_index):
- simple_project_bake(context, i, obj, mat_id)
- # Remove the projection attribute (data is now baked into texture)
- attr = obj.data.attributes.get(f"ProjectionUV_{i}_{mat_id}")
- if attr:
- obj.data.attributes.remove(attr)
-
# Clean up buffer UV map from all objects
for obj in to_project:
buffer_uv = obj.data.uv_layers.get(_SG_BUFFER_UV_NAME)
@@ -873,12 +854,13 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
# Create the material
to_switch = False
- if (context.scene.generation_method == "refine" or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'refine')) and context.scene.refine_preserve and not context.scene.overwrite_material:
+ is_local_edit = (context.scene.generation_method == 'local_edit' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'local_edit'))
+ if is_local_edit and not context.scene.overwrite_material:
# Copy active material
mat = obj.active_material.copy()
obj.data.materials.append(mat)
to_switch = True
- elif obj.active_material and (context.scene.overwrite_material or ((context.scene.generation_method == "refine" or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'refine')) and context.scene.refine_preserve) \
+ elif obj.active_material and (context.scene.overwrite_material or is_local_edit \
or (context.scene.generation_method == 'sequential' and stop_index > 0) or context.scene.generation_mode == 'regenerate_selected'):
# Use active material
mat = obj.active_material
@@ -944,14 +926,10 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
# We also need to set the generated image to the texture node with label {stop_index}-{mat_id}
for node in nodes:
if node.type == 'TEX_IMAGE' and node.label == f"{stop_index}-{mat_id}":
- if not context.scene.bake_texture:
- image_path = get_file_path(context, "generated", camera_id=stop_index, material_id=mat_id)
- if (context.scene.generation_method == 'sequential' or context.scene.generation_method == 'separate') and context.scene.sequential_ipadapter and context.scene.sequential_ipadapter_regenerate \
- and not context.scene.use_ipadapter and stop_index == 0 and context.scene.sequential_ipadapter_mode == 'first':
- image_path = get_file_path(context, "generated", camera_id=stop_index, material_id=mat_id).replace(".png", "_ipadapter.png")
- else:
- # Use baked texture
- image_path = get_file_path(context, "generated_baked", camera_id=stop_index, material_id=mat_id, object_name=obj.name)
+ image_path = get_file_path(context, "generated", camera_id=stop_index, material_id=mat_id)
+ if (context.scene.generation_method == 'sequential' or context.scene.generation_method == 'separate') and context.scene.sequential_ipadapter and context.scene.sequential_ipadapter_regenerate \
+ and not context.scene.use_ipadapter and stop_index == 0 and context.scene.sequential_ipadapter_mode == 'first':
+ image_path = get_file_path(context, "generated", camera_id=stop_index, material_id=mat_id).replace(".png", "_ipadapter.png")
image = get_or_load_image(image_path, force_reload=context.scene.overwrite_material)
if image:
@@ -960,7 +938,7 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
# Now we can continue to the next object
continue
- elif not context.scene.refine_preserve or not (context.scene.generation_method == 'refine' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'refine')):
+ elif not is_local_edit:
# Clear existing nodes
for node in nodes:
nodes.remove(node)
@@ -977,7 +955,7 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
else:
previous_node = output.inputs[0].links[0].from_node
- if not ((context.scene.generation_method == 'refine' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'refine')) and context.scene.refine_preserve):
+ if not is_local_edit:
output = nodes.new("ShaderNodeOutputMaterial")
output.location = (3000, 0)
@@ -1003,14 +981,10 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
# Add image texture node
tex_image = nodes.new("ShaderNodeTexImage")
if i <= stop_index:
- if not context.scene.bake_texture:
- image_path = get_file_path(context, "generated", camera_id=i, material_id=mat_id)
- if (context.scene.generation_method == 'sequential' or context.scene.generation_method == 'separate') and context.scene.sequential_ipadapter and context.scene.sequential_ipadapter_regenerate \
- and not context.scene.use_ipadapter and i == 0 and context.scene.sequential_ipadapter_mode == 'first':
- image_path = get_file_path(context, "generated", camera_id=i, material_id=mat_id).replace(".png", "_ipadapter.png")
- else:
- # Use baked texture
- image_path = get_file_path(context, "generated_baked", camera_id=i, material_id=mat_id, object_name=obj.name)
+ image_path = get_file_path(context, "generated", camera_id=i, material_id=mat_id)
+ if (context.scene.generation_method == 'sequential' or context.scene.generation_method == 'separate') and context.scene.sequential_ipadapter and context.scene.sequential_ipadapter_regenerate \
+ and not context.scene.use_ipadapter and i == 0 and context.scene.sequential_ipadapter_mode == 'first':
+ image_path = get_file_path(context, "generated", camera_id=i, material_id=mat_id).replace(".png", "_ipadapter.png")
image = get_or_load_image(image_path, force_reload=context.scene.overwrite_material)
if image:
@@ -1022,15 +996,10 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
tex_image_nodes.append(tex_image)
# Add UV map / attribute node
- if not context.scene.bake_texture:
- # Use ShaderNodeAttribute to read from the corner-domain attribute
- uv_map_node = nodes.new("ShaderNodeAttribute")
- uv_map_node.attribute_name = f"ProjectionUV_{i}_{mat_id}"
- uv_map_node.attribute_type = 'GEOMETRY'
- else:
- # Baked textures use the original UV map
- uv_map_node = nodes.new("ShaderNodeUVMap")
- uv_map_node.uv_map = original_uv_map.name
+ # Use ShaderNodeAttribute to read from the corner-domain attribute
+ uv_map_node = nodes.new("ShaderNodeAttribute")
+ uv_map_node.attribute_name = f"ProjectionUV_{i}_{mat_id}"
+ uv_map_node.attribute_type = 'GEOMETRY'
uv_map_node.location = (-200, -200 * (i+1))
uv_map_nodes.append(uv_map_node)
@@ -1048,8 +1017,8 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
scripts_to_connect = [] # No OSL scripts to connect
final_weight_node = None
- is_refine = (context.scene.generation_method == 'refine' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'refine')) and context.scene.refine_preserve
- if is_refine:
+ is_local_edit_mode = (context.scene.generation_method == 'local_edit' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'local_edit'))
+ if is_local_edit_mode:
feather_weight = create_native_feather(
nodes, links, normalize_node, camera_fov_node, camera_aspect_node,
camera_dir_node, camera_up_node, context, i, mat_id
@@ -1113,7 +1082,7 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
scripts_to_connect = [script_angle]
final_weight_node = None
- if (context.scene.generation_method == 'refine' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'refine')) and context.scene.refine_preserve:
+ if (context.scene.generation_method == 'local_edit' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'local_edit')):
# Add Feather script
script_feather = nodes.new("ShaderNodeScript")
script_feather.location = (-400, (-800) * i - 200) # Offset slightly
@@ -1206,7 +1175,7 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
length_nodes.append(length)
# Build mix shader tree
- if not context.scene.bake_texture and mat.name in processed_materials and (context.scene.generation_method == 'refine' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'refine')) and context.scene.refine_preserve:
+ if mat.name in processed_materials and is_local_edit:
# If we already processed this material, we don't need to rebuild the mix tree
# But we still need to connect the nodes for the current object (done in the loop below)
# We need to find the existing mix node to position the output node
@@ -1268,79 +1237,6 @@ def project_image(context, to_project, mat_id, stop_index=1000000):
subtract_node.location = (-1000, 0)
return True
-def simple_project_bake(context, camera_id, obj, mat_id):
- # Create a temporary material for the projection
- mat = bpy.data.materials.new(name="ProjectionMaterialTemp")
- obj.data.materials.append(mat)
-
- # Switch the active material to the new material (Switch to edit mode, select all, assign the material)
- obj.active_material_index = len(obj.material_slots) - 1
- bpy.context.view_layer.objects.active = obj
- bpy.ops.object.mode_set(mode='EDIT')
- bpy.ops.mesh.select_all(action='DESELECT')
- bpy.ops.mesh.select_all(action='SELECT')
- bpy.ops.object.material_slot_assign()
- bpy.ops.object.mode_set(mode='OBJECT')
-
- # Unwrap (only for the first camera)
- if camera_id == 0:
- unwrap(obj, context.scene.bake_unwrap_method, context.scene.bake_unwrap_overlap_only)
-
- # Enable use of nodes
- mat.use_nodes = True
- nodes = mat.node_tree.nodes
- links = mat.node_tree.links
-
- # Clear existing nodes
- for node in nodes:
- nodes.remove(node)
-
- # Add image texture node
- tex_image = nodes.new("ShaderNodeTexImage")
-
- file_path = get_file_path(context, "generated", camera_id=camera_id, material_id=mat_id)
- if (context.scene.generation_method == 'sequential' or context.scene.generation_method == 'separate') and context.scene.sequential_ipadapter and context.scene.sequential_ipadapter_regenerate \
- and not context.scene.use_ipadapter and camera_id == 0 and context.scene.sequential_ipadapter_mode == 'first':
- file_path = get_file_path(context, "generated", camera_id=camera_id, material_id=mat_id).replace(".png", "_ipadapter.png")
-
- image = get_or_load_image(file_path, force_reload=context.scene.overwrite_material)
- if image:
- tex_image.image = image
-
- # Add UV attribute node (reads from corner-domain attribute)
- uv_map_node = nodes.new("ShaderNodeAttribute")
- uv_map_node.attribute_name = f"ProjectionUV_{camera_id}_{mat_id}"
- uv_map_node.attribute_type = 'GEOMETRY'
-
- # Add BSDF node
- bsdf = nodes.new("ShaderNodeBsdfPrincipled")
- bsdf.inputs["Roughness"].default_value = 1.0
-
- # Add output node
- output = nodes.new("ShaderNodeOutputMaterial")
- links.new(uv_map_node.outputs["Vector"], tex_image.inputs["Vector"])
- # Connect the nodes
- if context.scene.apply_bsdf:
- links.new(tex_image.outputs["Color"], bsdf.inputs["Base Color"])
- links.new(bsdf.outputs["BSDF"], output.inputs["Surface"])
- else:
- links.new(tex_image.outputs["Color"], output.inputs["Surface"])
-
- # Bake texture using BakeTextures.bake_texture
- texture_size = context.scene.bake_texture_size
- original_engine = context.scene.render.engine
- prepare_baking(context)
-
- # If the object has no UV map, create one
- if not obj.data.uv_layers:
- obj.data.uv_layers.new(name="UVMap")
-
- bake_texture(context, obj, texture_size, suffix=f"{camera_id}-{mat_id}", output_dir=get_dir_path(context, "generated_baked"))
- context.scene.render.engine = original_engine
-
- # Remove the temporary material
- bpy.ops.object.material_slot_remove()
-
def get_or_create_osl_text(filename):
"""
diff --git a/stablegen/render_tools.py b/stablegen/render_tools.py
index 4ce9e1e..6533417 100644
--- a/stablegen/render_tools.py
+++ b/stablegen/render_tools.py
@@ -249,7 +249,7 @@ def flatten_projection_material_for_refine(context, obj, baked_image_path):
Replace the StableGen ProjectionMaterial on this object with a minimal
baked-base material that still matches the expectations of:
- export_emit_image / _setup_emit_material
- - project_image refine_preserve logic
+ - project_image local_edit logic
Final graph:
UV Map -> Baked Image -> MixRGB -> Principled BSDF -> Output
@@ -554,7 +554,7 @@ def export_emit_image(context, to_export, camera_id=None, bg_color=(0.5, 0.5, 0.
else:
final_path = os.path.join(output_dir, f"{output_file}0001.png")
- if context.scene.visibility_vignette and context.scene.generation_method == 'refine' and context.scene.refine_preserve:
+ if context.scene.visibility_vignette and (context.scene.generation_method == 'local_edit' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'local_edit')):
# Smooth edge feathering, no blocky mask
apply_vignette_to_mask(
final_path,
@@ -1078,7 +1078,7 @@ def export_visibility(context, to_export, obj=None, camera_visibility=None):
# Save the image
cv2.imwrite(image_path, image)
- if context.scene.visibility_vignette and context.scene.generation_method == 'refine' and context.scene.refine_preserve:
+ if context.scene.visibility_vignette and (context.scene.generation_method == 'local_edit' or (context.scene.model_architecture.startswith('qwen') and context.scene.qwen_generation_method == 'local_edit')):
apply_vignette_to_mask(
image_path,
feather_width=context.scene.visibility_vignette_width,
diff --git a/stablegen/stablegen.py b/stablegen/stablegen.py
index bccb0ff..721995a 100644
--- a/stablegen/stablegen.py
+++ b/stablegen/stablegen.py
@@ -7,19 +7,19 @@ import math # pylint: disable=import-error
# Stock presets
PRESETS = {
- "DEFAULT": {"description": "Default settings for general purpose generation", "control_after_generate": "fixed", "model_architecture": "sdxl", "steps": 8, "cfg": 1.5, "sampler": "dpmpp_2s_ancestral", "scheduler": "sgm_uniform", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 90.0, "weight_exponent": 3.0, "view_blend_use_color_match": False, "view_blend_color_match_method": "hm-mvgd-hm", "view_blend_color_match_strength": 1.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "bake_texture": False, "bake_texture_size": 2048, "bake_unwrap_method": "none", "bake_unwrap_overlap_only": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.7, "sequential_factor_smooth": 0.15, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": False, "sequential_ipadapter_mode": "first", "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "controlnet_units": [{'unit_type': 'depth', 'model_name': 'controlnet_depth_sdxl.safetensors', 'strength': 0.5, 'start_percent': 0.0, 'end_percent': 1.0, 'is_union': False, 'use_union_type': True}], "lora_units": [{'model_name': 'sdxl_lightning_8step_lora.safetensors', 'model_strength': 1.0, 'clip_strength': 1.0}]},
- "MODEL IS IMPORTANT": {"description": "Same as default, but is more guided by the model", "control_after_generate": "fixed", "model_architecture": "sdxl", "steps": 8, "cfg": 1.5, "sampler": "dpmpp_2s_ancestral", "scheduler": "sgm_uniform", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 90.0, "weight_exponent": 3.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "bake_texture": False, "bake_texture_size": 2048, "bake_unwrap_method": "none", "bake_unwrap_overlap_only": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.7, "sequential_factor_smooth": 0.15, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": False, "sequential_ipadapter_mode": "first", "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "controlnet_units": [{'unit_type': 'depth', 'model_name': 'controlnet_depth_sdxl.safetensors', 'strength': 0.75, 'start_percent': 0.0, 'end_percent': 1.0, 'is_union': False, 'use_union_type': True}], "lora_units": [{'model_name': 'sdxl_lightning_8step_lora.safetensors', 'model_strength': 1.0, 'clip_strength': 1.0}]},
- "CHARACTERS": {"description": "Optimized settings for character generation", "control_after_generate": "fixed", "model_architecture": "sdxl", "steps": 8, "cfg": 1.5, "sampler": "dpmpp_2s_ancestral", "scheduler": "sgm_uniform", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 80.0, "weight_exponent": 3.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "bake_texture": False, "bake_texture_size": 2048, "bake_unwrap_method": "none", "bake_unwrap_overlap_only": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.7, "sequential_factor_smooth": 0.1, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": True, "sequential_ipadapter_mode": "first", "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "controlnet_units": [{'unit_type': 'depth', 'model_name': 'controlnet_depth_sdxl.safetensors', 'strength': 0.5, 'start_percent': 0.0, 'end_percent': 1.0, 'is_union': False, 'use_union_type': True}], "lora_units": [{'model_name': 'sdxl_lightning_8step_lora.safetensors', 'model_strength': 1.0, 'clip_strength': 1.0}]},
- "CHARACTERS (ALTERNATIVE MASKING)": {"description": "Optimized for character generation. Uses alternative masking parameters to be more consistent between images, but may produce more artifacts. Try if \"Characters\" fails.", "control_after_generate": "fixed", "model_architecture": "sdxl", "steps": 8, "cfg": 1.5, "sampler": "dpmpp_2s_ancestral", "scheduler": "sgm_uniform", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 80.0, "weight_exponent": 3.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "bake_texture": False, "bake_texture_size": 2048, "bake_unwrap_method": "none", "bake_unwrap_overlap_only": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.5, "sequential_factor_smooth": 0.3499999940395355, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": True, "sequential_ipadapter_mode": "first", "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 10, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "controlnet_units": [{'unit_type': 'depth', 'model_name': 'controlnet_depth_sdxl.safetensors', 'strength': 0.5, 'start_percent': 0.0, 'end_percent': 1.0, 'is_union': False, 'use_union_type': True}], "lora_units": [{'model_name': 'sdxl_lightning_8step_lora.safetensors', 'model_strength': 1.0, 'clip_strength': 1.0}]},
- "QUICK DRAFT": {"description": "Optimized for speed", "control_after_generate": "fixed", "model_architecture": "sdxl", "steps": 4, "cfg": 1.0, "sampler": "dpmpp_2s_ancestral", "scheduler": "sgm_uniform", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 70.0, "weight_exponent": 3.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "bake_texture": False, "bake_texture_size": 2048, "bake_unwrap_method": "none", "bake_unwrap_overlap_only": True, "generation_method": "grid", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.7, "sequential_factor_smooth": 0.1, "sequential_ipadapter": True, "sequential_ipadapter_mode": "first", "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 2, "blur_mask_sigma": 1.0, "grow_mask_by": 2, "canny_threshold_low": 0, "canny_threshold_high": 80, "controlnet_units": [{'unit_type': 'depth', 'model_name': 'controlnet_depth_sdxl.safetensors', 'strength': 0.5, 'start_percent': 0.0, 'end_percent': 1.0, 'is_union': False, 'use_union_type': True}], "lora_units": [{'model_name': 'Hyper-SDXL-4steps-lora.safetensors', 'model_strength': 1.0, 'clip_strength': 1.0}]},
- "UV INPAINTING": {"description": "Recommended UV Inpainting setup. It is recommended to bake texutures manually before running the generation to fine-tune unwrapping and avoid lag when generating.", "control_after_generate": "fixed", "model_architecture": "sdxl", "steps": 10, "cfg": 1.5, "sampler": "dpmpp_2s_ancestral", "scheduler": "sgm_uniform", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 80.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "bake_texture": False, "bake_texture_size": 2048, "bake_unwrap_method": "none", "bake_unwrap_overlap_only": True, "generation_method": "uv_inpaint", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "3,0,1,2", "sequential_factor": 0.6000000238418579, "sequential_factor_smooth": 0.11000001430511475, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": True, "sequential_ipadapter_mode": "first", "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 3, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "lora_units": [{'model_name': 'sdxl_lightning_8step_lora.safetensors', 'model_strength': 1.0, 'clip_strength': 1.0}]}, # No ControlNet for UV Inpainting by default
- "ARCHITECTURE": {"description": "Prioritizes only the most straight-on camera for each point. This means details generated on flat surfaces will not get blurred by getting generated differently from two or more viewpoints. Does not use visibility masking. Each picture will get generated as new, consistency depends on IPAdapter + geometry.", "control_after_generate": "fixed", "model_architecture": "sdxl", "steps": 8, "cfg": 1.5, "sampler": "dpmpp_2s_ancestral", "scheduler": "sgm_uniform", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 80.0, "weight_exponent": 10.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "bake_texture": False, "bake_texture_size": 2048, "bake_unwrap_method": "none", "bake_unwrap_overlap_only": True, "generation_method": "separate", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": False, "sequential_custom_camera_order": "", "sequential_factor": 0.75, "sequential_factor_smooth": 0.15000000596046448, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": True, "sequential_ipadapter_mode": "first", "ipadapter_weight_type": "style", "ipadapter_strength": 0.800000011920929, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": False, "blur_mask": True, "blur_mask_radius": 3, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "controlnet_units": [{'unit_type': 'depth', 'model_name': 'controlnet_depth_sdxl.safetensors', 'strength': 0.6000000238418579, 'start_percent': 0.0, 'end_percent': 1.0, 'is_union': False, 'use_union_type': True}], "lora_units": [{'model_name': 'sdxl_lightning_8step_lora.safetensors', 'model_strength': 1.0, 'clip_strength': 1.0}]},
- "QWEN EDIT PRECISE": {"description": "Precise detail when camera overlap is good. Relies on context renders plus the prompt, so sparse coverage can still introduce artifacts.", "control_after_generate": "fixed", "model_architecture": "qwen_image_edit", "steps": 4, "cfg": 1.0, "sampler": "euler", "scheduler": "simple", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 70.0, "discard_factor_generation_only": True, "discard_factor_after_generation": 90.0, "weight_exponent": 3.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "bake_texture": False, "bake_texture_size": 2048, "bake_unwrap_method": "none", "bake_unwrap_overlap_only": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.699999988079071, "sequential_factor_smooth": 0.15000000596046448, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": False, "sequential_ipadapter_mode": "first", "sequential_desaturate_factor": 0.0, "sequential_contrast_factor": 0.0, "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "qwen_guidance_map_type": "depth", "qwen_use_external_style_image": False, "qwen_external_style_image": "", "qwen_context_render_mode": "REPLACE_STYLE", "qwen_external_style_initial_only": False, "qwen_use_custom_prompts": False, "qwen_custom_prompt_initial": "Change the format of image 1 to '{main_prompt}'", "qwen_custom_prompt_seq_none": "Change and transfer the format of '{main_prompt}' in image 1 to the style from image 2", "qwen_custom_prompt_seq_replace": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas.", "qwen_custom_prompt_seq_additional": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas. Image 3 represents the overall style of the object.", "qwen_guidance_fallback_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_guidance_background_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_context_cleanup": False, "qwen_context_cleanup_hue_tolerance": 0.0, "qwen_context_cleanup_value_adjust": 0.0, "qwen_context_fallback_dilation": 1, "qwen_rescale_alignment": True, "lora_units": [{'model_name': 'Qwen-Image-Edit-2509-Lightning-4steps-V1.0-bf16.safetensors', 'model_strength': 1.0, 'clip_strength': 0.0}]},
- "QWEN EDIT SAFE": {"description": "Safer fallback when coverage is limited. Uses the previous view (recent mode) instead of context renders to keep global look coherent, at the cost of some fine-detail persistence.", "control_after_generate": "fixed", "model_architecture": "qwen_image_edit", "steps": 4, "cfg": 1.0, "sampler": "euler", "scheduler": "simple", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 70.0, "discard_factor_generation_only": True, "discard_factor_after_generation": 90.0, "weight_exponent": 6.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "bake_texture": False, "bake_texture_size": 2048, "bake_unwrap_method": "none", "bake_unwrap_overlap_only": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.699999988079071, "sequential_factor_smooth": 0.15000000596046448, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": True, "sequential_ipadapter_mode": "first", "sequential_desaturate_factor": 0.0, "sequential_contrast_factor": 0.10000000149011612, "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "early_priority": False, "early_priority_strength": 0.5, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "qwen_guidance_map_type": "depth", "qwen_use_external_style_image": False, "qwen_external_style_image": "", "qwen_context_render_mode": "NONE", "qwen_external_style_initial_only": False, "qwen_use_custom_prompts": False, "qwen_custom_prompt_initial": "Change the format of image 1 to '{main_prompt}'", "qwen_custom_prompt_seq_none": "Change and transfer the format of '{main_prompt}' in image 1 to the style from image 2", "qwen_custom_prompt_seq_replace": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas.", "qwen_custom_prompt_seq_additional": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas. Image 3 represents the overall style of the object.", "qwen_guidance_fallback_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_guidance_background_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_context_cleanup": False, "qwen_context_cleanup_hue_tolerance": 0.0, "qwen_context_cleanup_value_adjust": 0.0, "qwen_context_fallback_dilation": 1, "qwen_rescale_alignment": True, "lora_units": [{'model_name': 'Qwen-Image-Edit-2509-Lightning-4steps-V1.0-bf16.safetensors', 'model_strength': 1.0, 'clip_strength': 0.0}]},
- "QWEN EDIT ALT": {"description": "Balanced option that mixes additional context renders with sequential references to smooth out coverage while keeping detail reasonable.", "control_after_generate": "fixed", "model_architecture": "qwen_image_edit", "steps": 4, "cfg": 1.0, "sampler": "euler", "scheduler": "simple", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 70.0, "discard_factor_generation_only": True, "discard_factor_after_generation": 90.0, "weight_exponent": 3.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "bake_texture": False, "bake_texture_size": 2048, "bake_unwrap_method": "none", "bake_unwrap_overlap_only": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.699999988079071, "sequential_factor_smooth": 0.15000000596046448, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": True, "sequential_ipadapter_mode": "recent", "sequential_desaturate_factor": 0.0, "sequential_contrast_factor": 0.10000000149011612, "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "qwen_guidance_map_type": "depth", "qwen_use_external_style_image": False, "qwen_external_style_image": "", "qwen_context_render_mode": "ADDITIONAL", "qwen_external_style_initial_only": False, "qwen_use_custom_prompts": False, "qwen_custom_prompt_initial": "Change the format of image 1 to '{main_prompt}'", "qwen_custom_prompt_seq_none": "Change and transfer the format of '{main_prompt}' in image 1 to the style from image 2", "qwen_custom_prompt_seq_replace": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas.", "qwen_custom_prompt_seq_additional": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas. Image 3 represents the overall style of the object.", "qwen_guidance_fallback_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_guidance_background_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_context_cleanup": False, "qwen_context_cleanup_hue_tolerance": 0.0, "qwen_context_cleanup_value_adjust": 0.0, "qwen_context_fallback_dilation": 1, "qwen_rescale_alignment": True, "early_priority": True, "early_priority_strength": 0.5, "lora_units": [{'model_name': 'Qwen-Image-Edit-2509-Lightning-4steps-V1.0-bf16.safetensors', 'model_strength': 1.0, 'clip_strength': 0.0}]},
- "QWEN EDIT PRECISE (NUNCHAKU)": {"description": "Precise detail using Nunchaku. Meant to be used with the Nunchaku model which has the 4-step Lightning LoRA included. Requires Nunchaku nodes.", "control_after_generate": "fixed", "model_architecture": "qwen_image_edit", "steps": 4, "cfg": 1.0, "sampler": "euler", "scheduler": "simple", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 70.0, "discard_factor_generation_only": True, "discard_factor_after_generation": 90.0, "weight_exponent": 3.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "bake_texture": False, "bake_texture_size": 2048, "bake_unwrap_method": "none", "bake_unwrap_overlap_only": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.699999988079071, "sequential_factor_smooth": 0.15000000596046448, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": False, "sequential_ipadapter_mode": "first", "sequential_desaturate_factor": 0.0, "sequential_contrast_factor": 0.0, "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "qwen_guidance_map_type": "depth", "qwen_use_external_style_image": False, "qwen_external_style_image": "", "qwen_context_render_mode": "REPLACE_STYLE", "qwen_external_style_initial_only": False, "qwen_use_custom_prompts": False, "qwen_custom_prompt_initial": "Change the format of image 1 to '{main_prompt}'", "qwen_custom_prompt_seq_none": "Change and transfer the format of '{main_prompt}' in image 1 to the style from image 2", "qwen_custom_prompt_seq_replace": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas.", "qwen_custom_prompt_seq_additional": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas. Image 3 represents the overall style of the object.", "qwen_guidance_fallback_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_guidance_background_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_context_cleanup": False, "qwen_context_cleanup_hue_tolerance": 0.0, "qwen_context_cleanup_value_adjust": 0.0, "qwen_context_fallback_dilation": 1, "qwen_rescale_alignment": True, "lora_units": []},
- "QWEN EDIT SAFE (NUNCHAKU)": {"description": "Safer fallback using Nunchaku. Meant to be used with the Nunchaku model which has the 4-step Lightning LoRA included. Requires Nunchaku nodes.", "control_after_generate": "fixed", "model_architecture": "qwen_image_edit", "steps": 4, "cfg": 1.0, "sampler": "euler", "scheduler": "simple", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 70.0, "discard_factor_generation_only": True, "discard_factor_after_generation": 90.0, "weight_exponent": 6.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "bake_texture": False, "bake_texture_size": 2048, "bake_unwrap_method": "none", "bake_unwrap_overlap_only": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.699999988079071, "sequential_factor_smooth": 0.15000000596046448, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": True, "sequential_ipadapter_mode": "first", "sequential_desaturate_factor": 0.0, "sequential_contrast_factor": 0.10000000149011612, "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "early_priority": False, "early_priority_strength": 0.5, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "qwen_guidance_map_type": "depth", "qwen_use_external_style_image": False, "qwen_external_style_image": "", "qwen_context_render_mode": "NONE", "qwen_external_style_initial_only": False, "qwen_use_custom_prompts": False, "qwen_custom_prompt_initial": "Change the format of image 1 to '{main_prompt}'", "qwen_custom_prompt_seq_none": "Change and transfer the format of '{main_prompt}' in image 1 to the style from image 2", "qwen_custom_prompt_seq_replace": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas.", "qwen_custom_prompt_seq_additional": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas. Image 3 represents the overall style of the object.", "qwen_guidance_fallback_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_guidance_background_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_context_cleanup": False, "qwen_context_cleanup_hue_tolerance": 0.0, "qwen_context_cleanup_value_adjust": 0.0, "qwen_context_fallback_dilation": 1, "qwen_rescale_alignment": True, "lora_units": []},
- "QWEN EDIT ALT (NUNCHAKU)": {"description": "Balanced option using Nunchaku. Meant to be used with the Nunchaku model which has the 4-step Lightning LoRA included. Requires Nunchaku nodes.", "control_after_generate": "fixed", "model_architecture": "qwen_image_edit", "steps": 4, "cfg": 1.0, "sampler": "euler", "scheduler": "simple", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 70.0, "discard_factor_generation_only": True, "discard_factor_after_generation": 90.0, "weight_exponent": 3.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "bake_texture": False, "bake_texture_size": 2048, "bake_unwrap_method": "none", "bake_unwrap_overlap_only": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.699999988079071, "sequential_factor_smooth": 0.15000000596046448, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": True, "sequential_ipadapter_mode": "recent", "sequential_desaturate_factor": 0.0, "sequential_contrast_factor": 0.10000000149011612, "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "qwen_guidance_map_type": "depth", "qwen_use_external_style_image": False, "qwen_external_style_image": "", "qwen_context_render_mode": "ADDITIONAL", "qwen_external_style_initial_only": False, "qwen_use_custom_prompts": False, "qwen_custom_prompt_initial": "Change the format of image 1 to '{main_prompt}'", "qwen_custom_prompt_seq_none": "Change and transfer the format of '{main_prompt}' in image 1 to the style from image 2", "qwen_custom_prompt_seq_replace": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas.", "qwen_custom_prompt_seq_additional": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas. Image 3 represents the overall style of the object.", "qwen_guidance_fallback_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_guidance_background_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_context_cleanup": False, "qwen_context_cleanup_hue_tolerance": 0.0, "qwen_context_cleanup_value_adjust": 0.0, "qwen_context_fallback_dilation": 1, "qwen_rescale_alignment": True, "early_priority": True, "early_priority_strength": 0.5, "lora_units": []},
+ "DEFAULT": {"description": "Default settings for general purpose generation", "control_after_generate": "fixed", "model_architecture": "sdxl", "steps": 8, "cfg": 1.5, "sampler": "dpmpp_2s_ancestral", "scheduler": "sgm_uniform", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 90.0, "weight_exponent": 3.0, "view_blend_use_color_match": False, "view_blend_color_match_method": "hm-mvgd-hm", "view_blend_color_match_strength": 1.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.7, "sequential_factor_smooth": 0.15, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": False, "sequential_ipadapter_mode": "first", "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "controlnet_units": [{'unit_type': 'depth', 'model_name': 'controlnet_depth_sdxl.safetensors', 'strength': 0.5, 'start_percent': 0.0, 'end_percent': 1.0, 'is_union': False, 'use_union_type': True}], "lora_units": [{'model_name': 'sdxl_lightning_8step_lora.safetensors', 'model_strength': 1.0, 'clip_strength': 1.0}]},
+ "MODEL IS IMPORTANT": {"description": "Same as default, but is more guided by the model", "control_after_generate": "fixed", "model_architecture": "sdxl", "steps": 8, "cfg": 1.5, "sampler": "dpmpp_2s_ancestral", "scheduler": "sgm_uniform", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 90.0, "weight_exponent": 3.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.7, "sequential_factor_smooth": 0.15, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": False, "sequential_ipadapter_mode": "first", "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "controlnet_units": [{'unit_type': 'depth', 'model_name': 'controlnet_depth_sdxl.safetensors', 'strength': 0.75, 'start_percent': 0.0, 'end_percent': 1.0, 'is_union': False, 'use_union_type': True}], "lora_units": [{'model_name': 'sdxl_lightning_8step_lora.safetensors', 'model_strength': 1.0, 'clip_strength': 1.0}]},
+ "CHARACTERS": {"description": "Optimized settings for character generation", "control_after_generate": "fixed", "model_architecture": "sdxl", "steps": 8, "cfg": 1.5, "sampler": "dpmpp_2s_ancestral", "scheduler": "sgm_uniform", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 80.0, "weight_exponent": 3.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.7, "sequential_factor_smooth": 0.1, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": True, "sequential_ipadapter_mode": "first", "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "controlnet_units": [{'unit_type': 'depth', 'model_name': 'controlnet_depth_sdxl.safetensors', 'strength': 0.5, 'start_percent': 0.0, 'end_percent': 1.0, 'is_union': False, 'use_union_type': True}], "lora_units": [{'model_name': 'sdxl_lightning_8step_lora.safetensors', 'model_strength': 1.0, 'clip_strength': 1.0}]},
+ "CHARACTERS (ALTERNATIVE MASKING)": {"description": "Optimized for character generation. Uses alternative masking parameters to be more consistent between images, but may produce more artifacts. Try if \"Characters\" fails.", "control_after_generate": "fixed", "model_architecture": "sdxl", "steps": 8, "cfg": 1.5, "sampler": "dpmpp_2s_ancestral", "scheduler": "sgm_uniform", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 80.0, "weight_exponent": 3.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.5, "sequential_factor_smooth": 0.3499999940395355, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": True, "sequential_ipadapter_mode": "first", "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 10, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "controlnet_units": [{'unit_type': 'depth', 'model_name': 'controlnet_depth_sdxl.safetensors', 'strength': 0.5, 'start_percent': 0.0, 'end_percent': 1.0, 'is_union': False, 'use_union_type': True}], "lora_units": [{'model_name': 'sdxl_lightning_8step_lora.safetensors', 'model_strength': 1.0, 'clip_strength': 1.0}]},
+ "QUICK DRAFT": {"description": "Optimized for speed", "control_after_generate": "fixed", "model_architecture": "sdxl", "steps": 4, "cfg": 1.0, "sampler": "dpmpp_2s_ancestral", "scheduler": "sgm_uniform", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 70.0, "weight_exponent": 3.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "generation_method": "grid", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.7, "sequential_factor_smooth": 0.1, "sequential_ipadapter": True, "sequential_ipadapter_mode": "first", "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 2, "blur_mask_sigma": 1.0, "grow_mask_by": 2, "canny_threshold_low": 0, "canny_threshold_high": 80, "controlnet_units": [{'unit_type': 'depth', 'model_name': 'controlnet_depth_sdxl.safetensors', 'strength': 0.5, 'start_percent': 0.0, 'end_percent': 1.0, 'is_union': False, 'use_union_type': True}], "lora_units": [{'model_name': 'Hyper-SDXL-4steps-lora.safetensors', 'model_strength': 1.0, 'clip_strength': 1.0}]},
+ "UV INPAINTING": {"description": "Recommended UV Inpainting setup. It is recommended to bake texutures manually before running the generation to fine-tune unwrapping and avoid lag when generating.", "control_after_generate": "fixed", "model_architecture": "sdxl", "steps": 10, "cfg": 1.5, "sampler": "dpmpp_2s_ancestral", "scheduler": "sgm_uniform", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 80.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "generation_method": "uv_inpaint", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "3,0,1,2", "sequential_factor": 0.6000000238418579, "sequential_factor_smooth": 0.11000001430511475, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": True, "sequential_ipadapter_mode": "first", "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 3, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "lora_units": [{'model_name': 'sdxl_lightning_8step_lora.safetensors', 'model_strength': 1.0, 'clip_strength': 1.0}]}, # No ControlNet for UV Inpainting by default
+ "ARCHITECTURE": {"description": "Prioritizes only the most straight-on camera for each point. This means details generated on flat surfaces will not get blurred by getting generated differently from two or more viewpoints. Does not use visibility masking. Each picture will get generated as new, consistency depends on IPAdapter + geometry.", "control_after_generate": "fixed", "model_architecture": "sdxl", "steps": 8, "cfg": 1.5, "sampler": "dpmpp_2s_ancestral", "scheduler": "sgm_uniform", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 80.0, "weight_exponent": 10.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "generation_method": "separate", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": False, "sequential_custom_camera_order": "", "sequential_factor": 0.75, "sequential_factor_smooth": 0.15000000596046448, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": True, "sequential_ipadapter_mode": "first", "ipadapter_weight_type": "style", "ipadapter_strength": 0.800000011920929, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": False, "blur_mask": True, "blur_mask_radius": 3, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "controlnet_units": [{'unit_type': 'depth', 'model_name': 'controlnet_depth_sdxl.safetensors', 'strength': 0.6000000238418579, 'start_percent': 0.0, 'end_percent': 1.0, 'is_union': False, 'use_union_type': True}], "lora_units": [{'model_name': 'sdxl_lightning_8step_lora.safetensors', 'model_strength': 1.0, 'clip_strength': 1.0}]},
+ "QWEN EDIT PRECISE": {"description": "Precise detail when camera overlap is good. Relies on context renders plus the prompt, so sparse coverage can still introduce artifacts.", "control_after_generate": "fixed", "model_architecture": "qwen_image_edit", "steps": 4, "cfg": 1.0, "sampler": "euler", "scheduler": "simple", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 70.0, "discard_factor_generation_only": True, "discard_factor_after_generation": 90.0, "weight_exponent": 3.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.699999988079071, "sequential_factor_smooth": 0.15000000596046448, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": False, "sequential_ipadapter_mode": "first", "sequential_desaturate_factor": 0.0, "sequential_contrast_factor": 0.0, "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "qwen_guidance_map_type": "depth", "qwen_use_external_style_image": False, "qwen_external_style_image": "", "qwen_context_render_mode": "REPLACE_STYLE", "qwen_external_style_initial_only": False, "qwen_use_custom_prompts": False, "qwen_custom_prompt_initial": "Change the format of image 1 to '{main_prompt}'", "qwen_custom_prompt_seq_none": "Change and transfer the format of '{main_prompt}' in image 1 to the style from image 2", "qwen_custom_prompt_seq_replace": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas.", "qwen_custom_prompt_seq_additional": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas. Image 3 represents the overall style of the object.", "qwen_guidance_fallback_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_guidance_background_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_context_cleanup": False, "qwen_context_cleanup_hue_tolerance": 0.0, "qwen_context_cleanup_value_adjust": 0.0, "qwen_context_fallback_dilation": 1, "qwen_rescale_alignment": True, "lora_units": [{'model_name': 'Qwen-Image-Edit-2509-Lightning-4steps-V1.0-bf16.safetensors', 'model_strength': 1.0, 'clip_strength': 0.0}]},
+ "QWEN EDIT SAFE": {"description": "Safer fallback when coverage is limited. Uses the previous view (recent mode) instead of context renders to keep global look coherent, at the cost of some fine-detail persistence.", "control_after_generate": "fixed", "model_architecture": "qwen_image_edit", "steps": 4, "cfg": 1.0, "sampler": "euler", "scheduler": "simple", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 70.0, "discard_factor_generation_only": True, "discard_factor_after_generation": 90.0, "weight_exponent": 6.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.699999988079071, "sequential_factor_smooth": 0.15000000596046448, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": True, "sequential_ipadapter_mode": "first", "sequential_desaturate_factor": 0.0, "sequential_contrast_factor": 0.10000000149011612, "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "early_priority": False, "early_priority_strength": 0.5, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "qwen_guidance_map_type": "depth", "qwen_use_external_style_image": False, "qwen_external_style_image": "", "qwen_context_render_mode": "NONE", "qwen_external_style_initial_only": False, "qwen_use_custom_prompts": False, "qwen_custom_prompt_initial": "Change the format of image 1 to '{main_prompt}'", "qwen_custom_prompt_seq_none": "Change and transfer the format of '{main_prompt}' in image 1 to the style from image 2", "qwen_custom_prompt_seq_replace": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas.", "qwen_custom_prompt_seq_additional": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas. Image 3 represents the overall style of the object.", "qwen_guidance_fallback_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_guidance_background_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_context_cleanup": False, "qwen_context_cleanup_hue_tolerance": 0.0, "qwen_context_cleanup_value_adjust": 0.0, "qwen_context_fallback_dilation": 1, "qwen_rescale_alignment": True, "lora_units": [{'model_name': 'Qwen-Image-Edit-2509-Lightning-4steps-V1.0-bf16.safetensors', 'model_strength': 1.0, 'clip_strength': 0.0}]},
+ "QWEN EDIT ALT": {"description": "Balanced option that mixes additional context renders with sequential references to smooth out coverage while keeping detail reasonable.", "control_after_generate": "fixed", "model_architecture": "qwen_image_edit", "steps": 4, "cfg": 1.0, "sampler": "euler", "scheduler": "simple", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 70.0, "discard_factor_generation_only": True, "discard_factor_after_generation": 90.0, "weight_exponent": 3.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.699999988079071, "sequential_factor_smooth": 0.15000000596046448, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": True, "sequential_ipadapter_mode": "recent", "sequential_desaturate_factor": 0.0, "sequential_contrast_factor": 0.10000000149011612, "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "qwen_guidance_map_type": "depth", "qwen_use_external_style_image": False, "qwen_external_style_image": "", "qwen_context_render_mode": "ADDITIONAL", "qwen_external_style_initial_only": False, "qwen_use_custom_prompts": False, "qwen_custom_prompt_initial": "Change the format of image 1 to '{main_prompt}'", "qwen_custom_prompt_seq_none": "Change and transfer the format of '{main_prompt}' in image 1 to the style from image 2", "qwen_custom_prompt_seq_replace": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas.", "qwen_custom_prompt_seq_additional": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas. Image 3 represents the overall style of the object.", "qwen_guidance_fallback_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_guidance_background_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_context_cleanup": False, "qwen_context_cleanup_hue_tolerance": 0.0, "qwen_context_cleanup_value_adjust": 0.0, "qwen_context_fallback_dilation": 1, "qwen_rescale_alignment": True, "early_priority": True, "early_priority_strength": 0.5, "lora_units": [{'model_name': 'Qwen-Image-Edit-2509-Lightning-4steps-V1.0-bf16.safetensors', 'model_strength': 1.0, 'clip_strength': 0.0}]},
+ "QWEN EDIT PRECISE (NUNCHAKU)": {"description": "Precise detail using Nunchaku. Meant to be used with the Nunchaku model which has the 4-step Lightning LoRA included. Requires Nunchaku nodes.", "control_after_generate": "fixed", "model_architecture": "qwen_image_edit", "steps": 4, "cfg": 1.0, "sampler": "euler", "scheduler": "simple", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 70.0, "discard_factor_generation_only": True, "discard_factor_after_generation": 90.0, "weight_exponent": 3.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.699999988079071, "sequential_factor_smooth": 0.15000000596046448, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": False, "sequential_ipadapter_mode": "first", "sequential_desaturate_factor": 0.0, "sequential_contrast_factor": 0.0, "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "qwen_guidance_map_type": "depth", "qwen_use_external_style_image": False, "qwen_external_style_image": "", "qwen_context_render_mode": "REPLACE_STYLE", "qwen_external_style_initial_only": False, "qwen_use_custom_prompts": False, "qwen_custom_prompt_initial": "Change the format of image 1 to '{main_prompt}'", "qwen_custom_prompt_seq_none": "Change and transfer the format of '{main_prompt}' in image 1 to the style from image 2", "qwen_custom_prompt_seq_replace": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas.", "qwen_custom_prompt_seq_additional": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas. Image 3 represents the overall style of the object.", "qwen_guidance_fallback_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_guidance_background_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_context_cleanup": False, "qwen_context_cleanup_hue_tolerance": 0.0, "qwen_context_cleanup_value_adjust": 0.0, "qwen_context_fallback_dilation": 1, "qwen_rescale_alignment": True, "lora_units": []},
+ "QWEN EDIT SAFE (NUNCHAKU)": {"description": "Safer fallback using Nunchaku. Meant to be used with the Nunchaku model which has the 4-step Lightning LoRA included. Requires Nunchaku nodes.", "control_after_generate": "fixed", "model_architecture": "qwen_image_edit", "steps": 4, "cfg": 1.0, "sampler": "euler", "scheduler": "simple", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 70.0, "discard_factor_generation_only": True, "discard_factor_after_generation": 90.0, "weight_exponent": 6.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.699999988079071, "sequential_factor_smooth": 0.15000000596046448, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": True, "sequential_ipadapter_mode": "first", "sequential_desaturate_factor": 0.0, "sequential_contrast_factor": 0.10000000149011612, "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "early_priority": False, "early_priority_strength": 0.5, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "qwen_guidance_map_type": "depth", "qwen_use_external_style_image": False, "qwen_external_style_image": "", "qwen_context_render_mode": "NONE", "qwen_external_style_initial_only": False, "qwen_use_custom_prompts": False, "qwen_custom_prompt_initial": "Change the format of image 1 to '{main_prompt}'", "qwen_custom_prompt_seq_none": "Change and transfer the format of '{main_prompt}' in image 1 to the style from image 2", "qwen_custom_prompt_seq_replace": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas.", "qwen_custom_prompt_seq_additional": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas. Image 3 represents the overall style of the object.", "qwen_guidance_fallback_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_guidance_background_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_context_cleanup": False, "qwen_context_cleanup_hue_tolerance": 0.0, "qwen_context_cleanup_value_adjust": 0.0, "qwen_context_fallback_dilation": 1, "qwen_rescale_alignment": True, "lora_units": []},
+ "QWEN EDIT ALT (NUNCHAKU)": {"description": "Balanced option using Nunchaku. Meant to be used with the Nunchaku model which has the 4-step Lightning LoRA included. Requires Nunchaku nodes.", "control_after_generate": "fixed", "model_architecture": "qwen_image_edit", "steps": 4, "cfg": 1.0, "sampler": "euler", "scheduler": "simple", "fallback_color": mathutils.Color((0.0, 0.0, 0.0)), "discard_factor": 70.0, "discard_factor_generation_only": True, "discard_factor_after_generation": 90.0, "weight_exponent": 3.0, "clip_skip": 1, "auto_rescale": True, "overwrite_material": True, "generation_method": "sequential", "refine_images": False, "refine_steps": 8, "refine_sampler": "dpmpp_2s_ancestral", "refine_scheduler": "sgm_uniform", "denoise": 1.0, "refine_cfg": 1.5, "refine_prompt": "", "refine_upscale_method": "lanczos", "sequential_smooth": True, "sequential_custom_camera_order": "", "sequential_factor": 0.699999988079071, "sequential_factor_smooth": 0.15000000596046448, "sequential_factor_smooth_2": 1.0, "sequential_ipadapter": True, "sequential_ipadapter_mode": "recent", "sequential_desaturate_factor": 0.0, "sequential_contrast_factor": 0.10000000149011612, "sequential_ipadapter_regenerate": False, "ipadapter_weight_type": "style", "ipadapter_strength": 1.0, "ipadapter_start": 0.0, "ipadapter_end": 1.0, "differential_diffusion": True, "differential_noise": True, "blur_mask": True, "blur_mask_radius": 1, "blur_mask_sigma": 1.0, "grow_mask_by": 3, "canny_threshold_low": 0, "canny_threshold_high": 80, "qwen_guidance_map_type": "depth", "qwen_use_external_style_image": False, "qwen_external_style_image": "", "qwen_context_render_mode": "ADDITIONAL", "qwen_external_style_initial_only": False, "qwen_use_custom_prompts": False, "qwen_custom_prompt_initial": "Change the format of image 1 to '{main_prompt}'", "qwen_custom_prompt_seq_none": "Change and transfer the format of '{main_prompt}' in image 1 to the style from image 2", "qwen_custom_prompt_seq_replace": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas.", "qwen_custom_prompt_seq_additional": "Change and transfer the format of image 1 to '{main_prompt}'. Replace all solid magenta areas in image 2. Replace the background with solid gray. The style from image 2 should smoothly continue into the previously magenta areas. Image 3 represents the overall style of the object.", "qwen_guidance_fallback_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_guidance_background_color": mathutils.Color((1.0, 0.0, 1.0)), "qwen_context_cleanup": False, "qwen_context_cleanup_hue_tolerance": 0.0, "qwen_context_cleanup_value_adjust": 0.0, "qwen_context_fallback_dilation": 1, "qwen_rescale_alignment": True, "early_priority": True, "early_priority_strength": 0.5, "lora_units": []},
}
# Global list of all generation parameter names to check for a preset.
@@ -42,10 +42,6 @@ GEN_PARAMETERS = [
"auto_rescale",
"auto_rescale_target_mp",
"overwrite_material",
- "bake_texture",
- "bake_texture_size",
- "bake_unwrap_method",
- "bake_unwrap_overlap_only",
"generation_method",
"refine_images",
"refine_steps",
@@ -550,19 +546,6 @@ class StableGenPanel(bpy.types.Panel):
row = content_box.row()
row.prop(scene, "overwrite_material", text="Overwrite Material", toggle=True, icon="FILE_REFRESH")
- row = content_box.row()
- row.prop(scene, "bake_texture", text="Bake Textures While Generating", toggle=True, icon="RENDER_STILL")
- if scene.bake_texture:
- sub_box = content_box.box()
- row = sub_box.row()
- row.prop(scene, "bake_texture_size", text="Bake Texture Resolution")
- split = sub_box.split(factor=0.5)
- split.label(text="Bake Unwrap Method:")
- split.prop(scene, "bake_unwrap_method", text="")
- if scene.bake_unwrap_method != 'none':
- row = sub_box.row()
- row.prop(scene, "bake_unwrap_overlap_only", text="Unwrap only overlapping UVs", toggle=True, icon="UV_SYNC_SELECT")
-
# --- Image Guidance (IPAdapter & ControlNet) ---
if scene.model_architecture in ['sdxl', 'flux1']:
content_box = draw_collapsible_section(advanced_params_box, "show_image_guidance_settings", "Image Guidance (IPAdapter & ControlNet)", icon="MODIFIER")
@@ -611,7 +594,7 @@ class StableGenPanel(bpy.types.Panel):
split.label(text="Context Render:")
split.prop(scene, "qwen_context_render_mode", text="")
- elif scene.qwen_generation_method == 'refine':
+ elif scene.qwen_generation_method in ('refine', 'local_edit'):
row = content_box.row()
row.prop(scene, "qwen_refine_use_prev_ref", text="Use Previous Refined View", toggle=True)
@@ -640,7 +623,7 @@ class StableGenPanel(bpy.types.Panel):
op.prompt_type = 'initial'
# Subsequent Images Prompt (conditional)
- if scene.generation_method == 'sequential' or (scene.qwen_generation_method == 'refine' and scene.qwen_refine_mode == 'sequential'):
+ if scene.generation_method == 'sequential' or (scene.qwen_generation_method in ('refine', 'local_edit') and scene.qwen_refine_mode == 'sequential'):
col = custom_prompt_box.column()
col.label(text="Subsequent Images Prompt:")
row = col.row(align=True)
@@ -794,41 +777,46 @@ class StableGenPanel(bpy.types.Panel):
mode_specific_outer_box = draw_collapsible_section(advanced_params_box, "show_mode_specific_settings", "Generation Mode Specifics", icon="OPTIONS")
if mode_specific_outer_box: # This is the box where all mode-specific UIs should go
- # Qwen Refine Mode Parameters
- if scene.model_architecture.startswith('qwen') and scene.qwen_generation_method == 'refine':
+ # Qwen Local Edit Mode Parameters
+ if scene.model_architecture.startswith('qwen') and scene.qwen_generation_method == 'local_edit':
row = mode_specific_outer_box.row()
row.alignment = 'CENTER'
- row.label(text="Qwen Refine Parameters", icon='SHADERFX')
-
+ row.label(text="Qwen Local Edit Parameters", icon='BRUSH_DATA')
row = mode_specific_outer_box.row()
- row.prop(scene, "refine_preserve", text="Preserve Original Textures", toggle=True, icon="TEXTURE")
+ row.prop(scene, "denoise", text="Denoise")
- if scene.refine_preserve:
- row = mode_specific_outer_box.row()
- # Angle Ramp Controls
- box = mode_specific_outer_box.box()
+ # Angle Ramp Controls
+ box = mode_specific_outer_box.box()
+ row = box.row()
+ row.prop(scene, "refine_angle_ramp_active", text="Use Angle-Based Blending", icon="DRIVER")
+ if scene.refine_angle_ramp_active:
row = box.row()
- row.prop(scene, "refine_angle_ramp_active", text="Use Angle-Based Blending", icon="DRIVER")
- if scene.refine_angle_ramp_active:
- row = box.row()
- row.prop(scene, "refine_angle_ramp_pos_0", text="Black Point")
- row.prop(scene, "refine_angle_ramp_pos_1", text="White Point")
-
- # Feather Ramp Controls
- box = mode_specific_outer_box.box()
+ row.prop(scene, "refine_angle_ramp_pos_0", text="Black Point")
+ row.prop(scene, "refine_angle_ramp_pos_1", text="White Point")
+
+ # Feather Ramp Controls
+ box = mode_specific_outer_box.box()
+ row = box.row()
+ row.prop(scene, "visibility_vignette", text="Use Vignette Blending", icon="DRIVER")
+ if scene.visibility_vignette:
row = box.row()
- row.prop(scene, "visibility_vignette", text="Use Vignette Blending", icon="DRIVER")
- if scene.visibility_vignette:
- row = box.row()
- row.prop(scene, "refine_feather_ramp_pos_0", text="Black Point")
- row.prop(scene, "refine_feather_ramp_pos_1", text="White Point")
- row = box.row()
- row.prop(scene, "visibility_vignette_width", text="Feather Width")
- if width_mode == 'narrow':
- row = box.row()
- row.prop(scene, "visibility_vignette_softness", text="Feather Softness")
+ row.prop(scene, "refine_feather_ramp_pos_0", text="Black Point")
+ row.prop(scene, "refine_feather_ramp_pos_1", text="White Point")
+ row = box.row()
+ row.prop(scene, "visibility_vignette_width", text="Feather Width")
+ if width_mode == 'narrow':
row = box.row()
- row.prop(scene, "visibility_vignette_blur", text="Blur Mask", icon="SURFACE_NSPHERE")
+ row.prop(scene, "visibility_vignette_softness", text="Feather Softness")
+ row = box.row()
+ row.prop(scene, "visibility_vignette_blur", text="Blur Mask", icon="SURFACE_NSPHERE")
+
+ # Qwen Refine Mode Parameters
+ elif scene.model_architecture.startswith('qwen') and scene.qwen_generation_method == 'refine':
+ row = mode_specific_outer_box.row()
+ row.alignment = 'CENTER'
+ row.label(text="Qwen Refine Parameters", icon='SHADERFX')
+ row = mode_specific_outer_box.row()
+ row.prop(scene, "denoise", text="Denoise")
# Grid Mode Parameters
elif scene.generation_method == 'grid':
@@ -914,37 +902,71 @@ class StableGenPanel(bpy.types.Panel):
row.label(text="Refine Mode Parameters", icon='SHADERFX')
row = mode_specific_outer_box.row()
row.prop(scene, "denoise", text="Denoise")
+ row = mode_specific_outer_box.row()
+ row.prop(scene, "sequential_ipadapter", text="Use IPAdapter for Refine Mode", toggle=True, icon="MODIFIER")
+ if scene.sequential_ipadapter:
+ sub_ip_box_separate = mode_specific_outer_box.box()
+
+ split = sub_ip_box_separate.split(factor=0.5)
+ split.label(text="Mode:")
+ split.prop(scene, "sequential_ipadapter_mode", text="")
+
+ split = sub_ip_box_separate.split(factor=0.5)
+ if context.scene.model_architecture == 'sdxl':
+ split.label(text="Weight Type:")
+ split.prop(scene, "ipadapter_weight_type", text="")
+
+ row = sub_ip_box_separate.row()
+ row.prop(scene, "ipadapter_strength", text="Strength")
+ if width_mode == 'narrow':
+ row = sub_ip_box_separate.row()
+ row.prop(scene, "ipadapter_start", text="Start")
+ if width_mode == 'narrow':
+ row = sub_ip_box_separate.row()
+ row.prop(scene, "ipadapter_end", text="End")
+
+ if context.scene.sequential_ipadapter_mode == 'first':
+ row = sub_ip_box_separate.row()
+ row.prop(scene, "sequential_ipadapter_regenerate", text="Regenerate First Image", toggle=True, icon="FILE_REFRESH")
+ if context.scene.sequential_ipadapter_regenerate:
+ row = sub_ip_box_separate.row()
+ row.prop(scene, "sequential_ipadapter_regenerate_wo_controlnet", text="Generate reference without ControlNet", toggle=True, icon="HIDE_OFF")
+
+ # Local Edit Mode Parameters
+ elif scene.generation_method == 'local_edit':
+ row = mode_specific_outer_box.row()
+ row.alignment = 'CENTER'
+ row.label(text="Local Edit Parameters", icon='BRUSH_DATA')
row = mode_specific_outer_box.row()
- row.prop(scene, "refine_preserve", text="Preserve Original Textures", toggle=True, icon="TEXTURE")
+ row.prop(scene, "denoise", text="Denoise")
- if scene.refine_preserve:
- row = mode_specific_outer_box.row()
- # Angle Ramp Controls
- box = mode_specific_outer_box.box()
+ # Angle Ramp Controls
+ box = mode_specific_outer_box.box()
+ row = box.row()
+ row.prop(scene, "refine_angle_ramp_active", text="Use Angle-Based Blending", icon="DRIVER")
+ if scene.refine_angle_ramp_active:
row = box.row()
- row.prop(scene, "refine_angle_ramp_active", text="Use Angle-Based Blending", icon="DRIVER")
- if scene.refine_angle_ramp_active:
- row = box.row()
- row.prop(scene, "refine_angle_ramp_pos_0", text="Black Point")
- row.prop(scene, "refine_angle_ramp_pos_1", text="White Point")
-
- # Feather Ramp Controls
- box = mode_specific_outer_box.box()
+ row.prop(scene, "refine_angle_ramp_pos_0", text="Black Point")
+ row.prop(scene, "refine_angle_ramp_pos_1", text="White Point")
+
+ # Feather Ramp Controls
+ box = mode_specific_outer_box.box()
+ row = box.row()
+ row.prop(scene, "visibility_vignette", text="Use Vignette Blending", icon="DRIVER")
+ if scene.visibility_vignette:
row = box.row()
- row.prop(scene, "visibility_vignette", text="Use Vignette Blending", icon="DRIVER")
- if scene.visibility_vignette:
- row = box.row()
- row.prop(scene, "refine_feather_ramp_pos_0", text="Black Point")
- row.prop(scene, "refine_feather_ramp_pos_1", text="White Point")
- row = box.row()
- row.prop(scene, "visibility_vignette_width", text="Feather Width")
- if width_mode == 'narrow':
- row = box.row()
- row.prop(scene, "visibility_vignette_softness", text="Feather Softness")
+ row.prop(scene, "refine_feather_ramp_pos_0", text="Black Point")
+ row.prop(scene, "refine_feather_ramp_pos_1", text="White Point")
+ row = box.row()
+ row.prop(scene, "visibility_vignette_width", text="Feather Width")
+ if width_mode == 'narrow':
row = box.row()
- row.prop(scene, "visibility_vignette_blur", text="Blur Mask", icon="SURFACE_NSPHERE")
+ row.prop(scene, "visibility_vignette_softness", text="Feather Softness")
+ row = box.row()
+ row.prop(scene, "visibility_vignette_blur", text="Blur Mask", icon="SURFACE_NSPHERE")
+
row = mode_specific_outer_box.row()
- row.prop(scene, "sequential_ipadapter", text="Use IPAdapter for Refine Mode", toggle=True, icon="MODIFIER")
+ row.prop(scene, "sequential_ipadapter", text="Use IPAdapter for Local Edit", toggle=True, icon="MODIFIER")
if scene.sequential_ipadapter:
sub_ip_box_separate = mode_specific_outer_box.box()
diff --git a/stablegen/util/mirror_color.py b/stablegen/util/mirror_color.py
index e60aba2..d41ec4d 100644
--- a/stablegen/util/mirror_color.py
+++ b/stablegen/util/mirror_color.py
@@ -203,7 +203,7 @@ class MirrorReproject(bpy.types.Operator):
def _do_refine_mirror(self, context, to_texture):
"""
- Special path for generation_method == 'refine' and refine_preserve == True.
+ Special path for generation_method == 'local_edit' (or qwen_generation_method == 'local_edit').
For each selected axis (X / Y / Z), we:
- Duplicate & mirror the active camera around that axis.
@@ -517,8 +517,8 @@ class MirrorReproject(bpy.types.Operator):
self.report({'ERROR'}, "No mesh objects found for texturing.")
return {'CANCELLED'}
- # Branch: refine+preserve vs everything else
- if scene.generation_method == 'refine' and getattr(scene, "refine_preserve", False):
+ # Branch: local_edit vs everything else
+ if scene.generation_method == 'local_edit' or (scene.model_architecture.startswith('qwen') and scene.qwen_generation_method == 'local_edit'):
return self._do_refine_mirror(context, to_texture)
else:
return self._do_standard_mirror(context, to_texture)
diff --git a/stablegen/workflows.py b/stablegen/workflows.py
index f175dc5..18d3cbb 100644
--- a/stablegen/workflows.py
+++ b/stablegen/workflows.py
@@ -586,7 +586,7 @@ class WorkflowManager:
base_prompt_text = context.scene.comfyui_prompt
# Camera Prompt Injection
- if context.scene.use_camera_prompts and context.scene.generation_method in ['separate', 'sequential', 'refine'] and self.operator._cameras and self.operator._current_image < len(self.operator._cameras):
+ if context.scene.use_camera_prompts and context.scene.generation_method in ['separate', 'sequential', 'refine', 'local_edit'] and self.operator._cameras and self.operator._current_image < len(self.operator._cameras):
current_camera_name = self.operator._cameras[self.operator._current_image].name
# Find the prompt in the collection
prompt_item = next((item for item in context.scene.camera_prompts if item.name == current_camera_name), None)
@@ -1066,7 +1066,7 @@ class WorkflowManager:
base_prompt_text = context.scene.comfyui_prompt
# Camera Prompt Injection
- if context.scene.use_camera_prompts and context.scene.generation_method in ['separate', 'sequential', 'refine', 'grid'] and self.operator._cameras and self.operator._current_image < len(self.operator._cameras):
+ if context.scene.use_camera_prompts and context.scene.generation_method in ['separate', 'sequential', 'refine', 'local_edit'] and self.operator._cameras and self.operator._current_image < len(self.operator._cameras):
current_camera_name = self.operator._cameras[self.operator._current_image].name
# Find the prompt in the collection
prompt_item = next((item for item in context.scene.camera_prompts if item.name == current_camera_name), None)
@@ -1076,7 +1076,7 @@ class WorkflowManager:
base_prompt_text = f"{view_desc}, {base_prompt_text}"
# Set positive prompt based on generation method
- if context.scene.generation_method in ['refine', 'uv_inpaint', 'sequential']:
+ if context.scene.generation_method in ['refine', 'local_edit', 'uv_inpaint', 'sequential']:
prompt[NODES['pos_prompt']]["inputs"]["text"] = base_prompt_text
else:
prompt[NODES['pos_prompt']]["inputs"]["text"] = context.scene.refine_prompt if context.scene.refine_prompt != "" else context.scene.comfyui_prompt
@@ -1090,7 +1090,7 @@ class WorkflowManager:
prompt[NODES['sampler']]["inputs"]["cfg"] = context.scene.refine_cfg if context.scene.generation_method == 'grid' else context.scene.cfg
prompt[NODES['sampler']]["inputs"]["sampler_name"] = context.scene.refine_sampler if context.scene.generation_method == 'grid' else context.scene.sampler
prompt[NODES['sampler']]["inputs"]["scheduler"] = context.scene.refine_scheduler if context.scene.generation_method == 'grid' else context.scene.scheduler
- if context.scene.generation_method == 'grid' or context.scene.generation_method == 'refine':
+ if context.scene.generation_method in ('grid', 'refine', 'local_edit'):
prompt[NODES['sampler']]["inputs"]["denoise"] = context.scene.denoise
else:
prompt[NODES['sampler']]["inputs"]["denoise"] = 1.0
@@ -1130,7 +1130,7 @@ class WorkflowManager:
prompt[NODES['ipadapter_loader']]["inputs"]["model"] = current_model_out
current_model_out = [NODES['ipadapter'], 0]
- if context.scene.differential_diffusion and NODES['differential_diffusion'] in prompt and not context.scene.generation_method == 'refine':
+ if context.scene.differential_diffusion and NODES['differential_diffusion'] in prompt and context.scene.generation_method not in ('refine', 'local_edit'):
# Set model input for differential diffusion
prompt[NODES['differential_diffusion']]["inputs"]["model"] = current_model_out
current_model_out = [NODES['differential_diffusion'], 0]
@@ -1143,7 +1143,7 @@ class WorkflowManager:
def _configure_refinement_mode(self, prompt, context, render_info, mask_info, NODES):
"""Configures the prompt based on the specific refinement mode."""
# Configure based on generation method
- if context.scene.generation_method == 'refine':
+ if context.scene.generation_method in ('refine', 'local_edit'):
prompt[NODES['vae_encode']]["inputs"]["pixels"] = [NODES['render_image'], 0] # Use render directly
elif context.scene.generation_method == 'uv_inpaint' or context.scene.generation_method == 'sequential':
@@ -1209,7 +1209,7 @@ class WorkflowManager:
def _configure_ipadapter_refine(self, prompt, context, ipadapter_ref_info, NODES):
"""Configures IPAdapter settings for refinement mode."""
# Connect IPAdapter output to the appropriate node
- if context.scene.differential_diffusion and context.scene.generation_method != 'refine':
+ if context.scene.differential_diffusion and context.scene.generation_method not in ('refine', 'local_edit'):
prompt[NODES['differential_diffusion']]["inputs"]["model"] = [NODES['ipadapter'], 0]
else:
prompt[NODES['sampler']]["inputs"]["model"] = [NODES['ipadapter'], 0]
@@ -1252,9 +1252,9 @@ class WorkflowManager:
"""Builds the ControlNet chain for refinement process."""
# Determine inputs for ControlNet chain
pos_input = NODES['pos_prompt'] if (not context.scene.differential_diffusion or
- context.scene.generation_method in ["grid", "refine"]) else NODES['inpaint_conditioning']
+ context.scene.generation_method in ["grid", "refine", "local_edit"]) else NODES['inpaint_conditioning']
neg_input = NODES['neg_prompt'] if (not context.scene.differential_diffusion or
- context.scene.generation_method in ["grid", "refine"]) else NODES['inpaint_conditioning']
+ context.scene.generation_method in ["grid", "refine", "local_edit"]) else NODES['inpaint_conditioning']
vae_input = NODES['checkpoint']
# Build the ControlNet chain
@@ -1293,7 +1293,7 @@ class WorkflowManager:
base_prompt_text = context.scene.comfyui_prompt
# Camera Prompt Injection
- if context.scene.use_camera_prompts and context.scene.generation_method in ['separate', 'sequential', 'refine'] and self.operator._cameras and self.operator._current_image < len(self.operator._cameras):
+ if context.scene.use_camera_prompts and context.scene.generation_method in ['separate', 'sequential', 'refine', 'local_edit'] and self.operator._cameras and self.operator._current_image < len(self.operator._cameras):
current_camera_name = self.operator._cameras[self.operator._current_image].name
# Find the prompt in the collection
prompt_item = next((item for item in context.scene.camera_prompts if item.name == current_camera_name), None)
@@ -1494,7 +1494,7 @@ class WorkflowManager:
base_prompt_text = context.scene.comfyui_prompt
# Camera Prompt Injection
- if context.scene.use_camera_prompts and context.scene.generation_method in ['separate', 'sequential', 'refine', 'grid'] and self.operator._cameras and self.operator._current_image < len(self.operator._cameras):
+ if context.scene.use_camera_prompts and context.scene.generation_method in ['separate', 'sequential', 'refine', 'local_edit', 'grid'] and self.operator._cameras and self.operator._current_image < len(self.operator._cameras):
current_camera_name = self.operator._cameras[self.operator._current_image].name
# Find the prompt in the collection
prompt_item = next((item for item in context.scene.camera_prompts if item.name == current_camera_name), None)
@@ -1509,7 +1509,7 @@ class WorkflowManager:
# Configure sampler parameters
prompt[NODES['noise']]["inputs"]["noise_seed"] = context.scene.seed
prompt[NODES['scheduler']]["inputs"]["steps"] = context.scene.refine_steps if context.scene.generation_method == 'grid' else context.scene.steps
- prompt[NODES['scheduler']]["inputs"]["denoise"] = context.scene.denoise if context.scene.generation_method in ['grid', 'refine'] else 1.0
+ prompt[NODES['scheduler']]["inputs"]["denoise"] = context.scene.denoise if context.scene.generation_method in ['grid', 'refine', 'local_edit'] else 1.0
prompt[NODES['flux_guidance']]["inputs"]["guidance"] = context.scene.refine_cfg if context.scene.generation_method == 'grid' else context.scene.cfg
prompt[NODES['ksampler']]["inputs"]["sampler_name"] = context.scene.refine_sampler if context.scene.generation_method == 'grid' else context.scene.sampler
prompt[NODES['scheduler']]["inputs"]["scheduler"] = context.scene.refine_scheduler if context.scene.generation_method == 'grid' else context.scene.scheduler
@@ -1644,7 +1644,7 @@ class WorkflowManager:
def _configure_refinement_mode_flux(self, prompt, context, render_info, mask_info, ipadapter_ref_info, NODES):
"""Configures the prompt based on the specific refinement mode for Flux."""
# Configure based on generation method
- if context.scene.generation_method == 'refine':
+ if context.scene.generation_method in ('refine', 'local_edit'):
# Configure for refine mode - load render directly
if render_info:
prompt[NODES['render_image']]["inputs"]["image"] = render_info['name']