From 789e09535db5e7b96a79454a6f08f57081c424e3 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sat, 4 Apr 2026 16:31:53 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20SelvaSampler=20=E2=80=94=20negative=5Fpr?= =?UTF-8?q?ompt=20above=20settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move negative_prompt to required inputs, right after prompt, so it appears above duration/steps/cfg/seed in the ComfyUI node layout. Co-Authored-By: Claude Sonnet 4.6 --- nodes/selva_sampler.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/nodes/selva_sampler.py b/nodes/selva_sampler.py index bd39fbf..550bcaa 100644 --- a/nodes/selva_sampler.py +++ b/nodes/selva_sampler.py @@ -15,6 +15,10 @@ class SelvaSampler: "default": "", "multiline": True, "tooltip": "CLIP text for audio generation. Leave empty to reuse the prompt from SelvaFeatureExtractor.", }), + "negative_prompt": ("STRING", { + "default": "", "multiline": True, + "tooltip": "Sounds to steer away from, e.g. 'wind noise, background music'.", + }), "duration": ("FLOAT", { "default": 0.0, "min": 0.0, "max": 30.0, "step": 0.1, "tooltip": "Audio duration in seconds. 0 = use duration from features.", @@ -25,12 +29,7 @@ class SelvaSampler: "tooltip": "CFG scale (SelVA default is 4.5)."}), "seed": ("INT", {"default": 0, "min": 0, "max": 0xFFFFFFFF}), }, - "optional": { - "negative_prompt": ("STRING", { - "default": "", "multiline": True, - "tooltip": "Sounds to steer away from, e.g. 'wind noise, background music'.", - }), - }, + "optional": {}, } RETURN_TYPES = ("AUDIO",) @@ -38,7 +37,7 @@ class SelvaSampler: FUNCTION = "generate" CATEGORY = PRISMAUDIO_CATEGORY - def generate(self, model, features, prompt, duration, steps, cfg_strength, seed, negative_prompt=None): + def generate(self, model, features, prompt, negative_prompt, duration, steps, cfg_strength, seed): from selva_core.model.flow_matching import FlowMatching from selva_core.model.sequence_config import SequenceConfig @@ -96,7 +95,7 @@ class SelvaSampler: # Encode negative prompt (or use empty conditions) neg_text_clip = feature_utils.encode_text_clip([negative_prompt]) \ - if negative_prompt and negative_prompt.strip() else None + if negative_prompt.strip() else None conditions = net_generator.preprocess_conditions(clip_f, sync_f, text_clip) empty_conditions = net_generator.get_empty_conditions(