Skip to content

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

add back missing guidance parameters for sdxl and flux

sakalondd6f0f60a2b8b
diff --git a/stablegen/stablegen.py b/stablegen/stablegen.py
index 3e7a973..00ed778 100755
--- a/stablegen/stablegen.py
+++ b/stablegen/stablegen.py
@@ -642,50 +642,77 @@ class StableGenPanel(bpy.types.Panel):
row.prop(scene, "qwen_context_cleanup_value_adjust", text="Value Adjust")
elif scene.model_architecture == 'sdxl' or scene.model_architecture == 'flux1':
- # ControlNet settings
- cn_box = content_box.box()
- row = cn_box.row()
- row.alignment = 'CENTER'
- row.label(text="ControlNet Units", icon="NODETREE")
- for i, unit in enumerate(scene.controlnet_units):
- sub_unit_box = cn_box.box() # Each unit gets its own box
- row = sub_unit_box.row()
- row.label(text=f"Unit: {unit.unit_type.replace('_', ' ').title()}", icon="DOT")
- row.alignment = 'LEFT'
-
- if width_mode == 'narrow':
- split = sub_unit_box.split(factor=0.35, align=True)
- else:
- split = sub_unit_box.split(factor=0.2, align=True)
- split.label(text="Model:")
- split.prop(unit, "model_name", text="")
-
- row = sub_unit_box.row()
- row.prop(unit, "strength", text="Strength")
- if width_mode == 'narrow':
- row = sub_unit_box.row()
- row.prop(unit, "start_percent", text="Start")
- if width_mode == 'narrow':
+ # IPAdapter Parameters
+ if not scene.generation_method == 'uv_inpaint':
+ ipadapter_main_box = content_box.box() # Group IPAdapter settings together
+ if scene.model_architecture == 'flux1':
+ row = ipadapter_main_box.row()
+ row.prop(scene, "use_flux_lora", text="Use Flux Depth LoRA", toggle=True, icon="MODIFIER")
+ row = ipadapter_main_box.row()
+ row.prop(scene, "use_ipadapter", text="Use IPAdapter (External image)", toggle=True, icon="MOD_MULTIRES")
+ if scene.use_ipadapter:
+ sub_ip_box = ipadapter_main_box.box()
+ row = sub_ip_box.row()
+ row.prop(scene, "ipadapter_image", text="Image")
+ row = sub_ip_box.row()
+ row.prop(scene, "ipadapter_strength", text="Strength")
+ if width_mode == 'narrow':
+ row = sub_ip_box.row()
+ row.prop(scene, "ipadapter_start", text="Start")
+ if width_mode == 'narrow':
+ row = sub_ip_box.row()
+ row.prop(scene, "ipadapter_end", text="End")
+ split = sub_ip_box.split(factor=0.5)
+ if context.scene.model_architecture == 'sdxl':
+ split.label(text="Weight Type:")
+ split.prop(scene, "ipadapter_weight_type", text="")
+
+ content_box.separator() # Separator between IPAdapter and ControlNet if both are shown
+ # ControlNet Parameters
+ if not (scene.model_architecture == 'flux1' and scene.use_flux_lora):
+ cn_box = content_box.box()
+ row = cn_box.row()
+ row.alignment = 'CENTER'
+ row.label(text="ControlNet Units", icon="NODETREE")
+ for i, unit in enumerate(scene.controlnet_units):
+ sub_unit_box = cn_box.box() # Each unit gets its own box
row = sub_unit_box.row()
- row.prop(unit, "end_percent", text="End")
-
- if unit.unit_type == 'canny':
+ row.label(text=f"Unit: {unit.unit_type.replace('_', ' ').title()}", icon="DOT")
+ row.alignment = 'LEFT'
+
+ if width_mode == 'narrow':
+ split = sub_unit_box.split(factor=0.35, align=True)
+ else:
+ split = sub_unit_box.split(factor=0.2, align=True)
+ split.label(text="Model:")
+ split.prop(unit, "model_name", text="")
+
row = sub_unit_box.row()
- row.prop(scene, "canny_threshold_low", text="Canny Low")
+ row.prop(unit, "strength", text="Strength")
if width_mode == 'narrow':
row = sub_unit_box.row()
- row.prop(scene, "canny_threshold_high", text="Canny High")
- if hasattr(unit, 'is_union') and unit.is_union:
- row = sub_unit_box.row()
- row.prop(unit, "use_union_type", text="Set Union Type", toggle=True, icon="MOD_BOOLEAN")
-
- btn_row = cn_box.row(align=True)
- if width_mode == 'wide':
- btn_row.operator("stablegen.add_controlnet_unit", text="Add Unit", icon="ADD")
- btn_row.operator("stablegen.remove_controlnet_unit", text="Remove Unit", icon="REMOVE")
- else:
- cn_box.operator("stablegen.add_controlnet_unit", text="Add ControlNet Unit", icon="ADD")
- cn_box.operator("stablegen.remove_controlnet_unit", text="Remove Last ControlNet Unit", icon="REMOVE")
+ row.prop(unit, "start_percent", text="Start")
+ if width_mode == 'narrow':
+ row = sub_unit_box.row()
+ row.prop(unit, "end_percent", text="End")
+
+ if unit.unit_type == 'canny':
+ row = sub_unit_box.row()
+ row.prop(scene, "canny_threshold_low", text="Canny Low")
+ if width_mode == 'narrow':
+ row = sub_unit_box.row()
+ row.prop(scene, "canny_threshold_high", text="Canny High")
+ if hasattr(unit, 'is_union') and unit.is_union:
+ row = sub_unit_box.row()
+ row.prop(unit, "use_union_type", text="Set Union Type", toggle=True, icon="MOD_BOOLEAN")
+
+ btn_row = cn_box.row(align=True)
+ if width_mode == 'wide':
+ btn_row.operator("stablegen.add_controlnet_unit", text="Add Unit", icon="ADD")
+ btn_row.operator("stablegen.remove_controlnet_unit", text="Remove Unit", icon="REMOVE")
+ else:
+ cn_box.operator("stablegen.add_controlnet_unit", text="Add ControlNet Unit", icon="ADD")
+ cn_box.operator("stablegen.remove_controlnet_unit", text="Remove Last ControlNet Unit", icon="REMOVE")
if not scene.model_architecture == 'qwen_image_edit':
# --- Inpainting Options (Conditional) ---