Transform your 3D texturing workflow with the power of generative AI, directly within Blender!
name confidence-gated context again and trust context from 0.5
sakalond89cead2bc669
diff --git a/stablegen/core/properties.py b/stablegen/core/properties.pyindex b7b2ba3..5a2f7d0 100644--- a/stablegen/core/properties.py+++ b/stablegen/core/properties.py@@ -1273,8 +1273,8 @@ def register_properties(update_model_list, ControlNetUnit, LoRAUnit,default=1, min=0, max=64, update=update_parameters)bpy.types.Scene.qwen_use_confidence_context = bpy.props.BoolProperty(- name="Protect reliable context",- description="Protect context observed reliably by previous source cameras and mark unreliable regions for regeneration. This confidence decision is separate from the displayed RGB mixture.",+ name="Confidence-Gated Context",+ description="Replace the context weighting: each later view keeps only the context whose best earlier source view reaches the minimum trusted view quality, and everything below it is blanked to the missing-context color and generated again. The displayed RGB blend is unchanged.",default=TEXTURING_DEFAULTS["qwen_use_confidence_context"], update=update_parameters,)bpy.types.Scene.qwen_regularize_context_mask = bpy.props.BoolProperty(@@ -1284,8 +1284,8 @@ def register_properties(update_model_list, ControlNetUnit, LoRAUnit,)bpy.types.Scene.qwen_trust_threshold = bpy.props.FloatProperty(name="Minimum trusted view quality",- description="Minimum geometric source-view quality needed to protect existing context. Higher values mark more surface for repair; this is not an artistic image-quality score.",- default=0.70, min=0.0, max=1.0, update=update_parameters,+ description="Minimum geometric source-view quality needed to keep existing context. Higher values blank more surface for regeneration; this is not an artistic image-quality score.",+ default=0.50, min=0.0, max=1.0, update=update_parameters,)bpy.types.Scene.qwen_mask_min_island_area = bpy.props.IntProperty(name="Minimum trusted island (px²)",diff --git a/stablegen/texturing/generator.py b/stablegen/texturing/generator.pyindex f6b0566..1a7772e 100644--- a/stablegen/texturing/generator.py+++ b/stablegen/texturing/generator.py@@ -614,7 +614,7 @@ class ComfyUIGenerate(_PBRMixin, bpy.types.Operator):camera_id,repair_mask=repair_path,trusted_mask=trusted_path,- trust_threshold=getattr(context.scene, 'qwen_trust_threshold', 0.7),+ trust_threshold=getattr(context.scene, 'qwen_trust_threshold', 0.5),)# These files are generated immediately before their first upload, but@@ -1552,7 +1552,7 @@ class ComfyUIGenerate(_PBRMixin, bpy.types.Operator):reliable = []risks = []- trust = float(getattr(context.scene, 'qwen_trust_threshold', 0.7))+ trust = float(getattr(context.scene, 'qwen_trust_threshold', 0.5))discard_cosine = math.cos(math.radians(float(context.scene.discard_factor)))front_threshold = max(0.0, min(1.0, max(trust, discard_cosine)))homogeneous_positions = np.concatenate(diff --git a/stablegen/texturing/rendering.py b/stablegen/texturing/rendering.pyindex 359d7c6..8c7c748 100644--- a/stablegen/texturing/rendering.py+++ b/stablegen/texturing/rendering.py@@ -1597,7 +1597,7 @@ def _export_visibility_impl(context, to_export, obj=None, camera_visibility=Nonetrusted = nodes.new("ShaderNodeMath")trusted.operation = 'GREATER_THAN'trusted.inputs[1].default_value = float(getattr(- context.scene, 'qwen_trust_threshold', 0.7+ context.scene, 'qwen_trust_threshold', 0.5)) - 1e-7trusted.label = "SGTrustedContext"links.new(source_quality.outputs[0], trusted.inputs[0])diff --git a/stablegen/ui/panel.py b/stablegen/ui/panel.pyindex 95d8f07..6bf0dd1 100644--- a/stablegen/ui/panel.py+++ b/stablegen/ui/panel.py@@ -1840,7 +1840,7 @@ class StableGenPanel(bpy.types.Panel):context_box.prop(scene,"qwen_use_confidence_context",- text="Protect reliable context",+ text="Confidence-Gated Context",toggle=True,icon="MOD_MASK",)@@ -2422,7 +2422,7 @@ class StableGenPanel(bpy.types.Panel):context_box.prop(scene,"qwen_use_confidence_context",- text="Protect reliable context",+ text="Confidence-Gated Context",toggle=True,icon="MOD_MASK",)diff --git a/stablegen/ui/studio_cards.py b/stablegen/ui/studio_cards.pyindex 0efe806..9c129c4 100644--- a/stablegen/ui/studio_cards.py+++ b/stablegen/ui/studio_cards.py@@ -269,7 +269,7 @@ LABELS = {'sequential_ipadapter_mode': 'Reference source','sequential_desaturate_factor': 'Reference desaturation','sequential_contrast_factor': 'Reference contrast reduction',- 'qwen_use_confidence_context': 'Protect reliable context',+ 'qwen_use_confidence_context': 'Confidence-gated context','qwen_trust_threshold': 'Minimum trusted view quality','qwen_guidance_fallback_color': 'Missing-context color','qwen_guidance_background_color': 'Image background',