Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/BuiltinExtensions/ComfyUIBackend/WorkflowGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2311,6 +2311,7 @@ public JArray CreateConditioningDirect(string prompt, JArray clip, T2IModel mode
return [nodeId, 0];
}
string node;
bool isPlainTextEncode = false;
double mult = isPositive ? 1.5 : 0.8;
int width = UserInput.GetImageWidth();
int height = UserInput.GetImageHeight();
Expand Down Expand Up @@ -2501,6 +2502,7 @@ public JArray CreateConditioningDirect(string prompt, JArray clip, T2IModel mode
["target_height"] = height,
["guidance"] = UserInput.Get(T2IParamTypes.FluxGuidanceScale, defaultGuidance)
}, id);
isPlainTextEncode = true;
}
else if (model is not null && model.ModelClass is not null && model.ModelClass.ID == "stable-diffusion-xl-v1-base")
{
Expand All @@ -2516,6 +2518,7 @@ public JArray CreateConditioningDirect(string prompt, JArray clip, T2IModel mode
["target_width"] = width,
["target_height"] = height
}, id);
isPlainTextEncode = true;
}
else
{
Expand All @@ -2524,6 +2527,15 @@ public JArray CreateConditioningDirect(string prompt, JArray clip, T2IModel mode
["clip"] = clip,
["text"] = prompt
}, id);
isPlainTextEncode = true;
}
if (isPlainTextEncode && UserInput.TryGet(T2IParamTypes.ConditioningMultiplier, out double condMultiplier) && condMultiplier != 1)

@mcmonkey4eva mcmonkey4eva Jul 9, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Silent exclusion for incompatibility image-input conds is awkward.
Also I feel like positive/negative prompt difference would be relevant here?
(Or I guess for Krea it doesn't really matter cause Turbo. but like. idk.)

{
node = CreateNode("ConditioningMultiply", new JObject()
{
["conditioning"] = NodePath(node, 0),
["multiplier"] = condMultiplier
});
}
NodeHelpers[trackerId] = node;
return [node, 0];
Expand Down
5 changes: 4 additions & 1 deletion src/Text2Image/T2IParamTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public static string ApplyStringEdit(string prior, string update)
public static T2IRegisteredParam<int> Images, Steps, Width, Height, SideLength, BatchSize, VAETileSize, VAETileOverlap, VAETemporalTileSize, VAETemporalTileOverlap, ClipStopAtLayer, VideoFrames, VideoMotionBucket, VideoFPS, VideoSteps, RefinerSteps, CascadeLatentCompression, MaskShrinkGrow, MaskBlur, MaskGrow, SegmentMaskBlur, SegmentMaskGrow, SegmentMaskOversize, SegmentSteps, Text2VideoFrames, TrimVideoStartFrames, TrimVideoEndFrames, VideoExtendFrameOverlap;
public static T2IRegisteredParam<long> Seed, VariationSeed, WildcardSeed, Text2AudioBPM;
public static T2IRegisteredParam<double> CFGScale, VariationSeedStrength, InitImageCreativity, InitImageResetToNorm, InitImageNoise, RefinerControl, RefinerUpscale, RefinerCFGScale, ReVisionStrength, AltResolutionHeightMult,
FreeUBlock1, FreeUBlock2, FreeUSkip1, FreeUSkip2, GlobalRegionFactor, EndStepsEarly, SamplerSigmaMin, SamplerSigmaMax, SamplerRho, VideoAugmentationLevel, VideoCFG, VideoMinCFG, Video2VideoCreativity, VideoSwapPercent, VideoExtendSwapPercent, IP2PCFG2, RegionalObjectCleanupFactor, SigmaShift, SegmentThresholdMax, SegmentCFGScale, FluxGuidanceScale, Text2AudioDuration;
FreeUBlock1, FreeUBlock2, FreeUSkip1, FreeUSkip2, GlobalRegionFactor, EndStepsEarly, SamplerSigmaMin, SamplerSigmaMax, SamplerRho, VideoAugmentationLevel, VideoCFG, VideoMinCFG, Video2VideoCreativity, VideoSwapPercent, VideoExtendSwapPercent, IP2PCFG2, RegionalObjectCleanupFactor, SigmaShift, SegmentThresholdMax, SegmentCFGScale, FluxGuidanceScale, Text2AudioDuration, ConditioningMultiplier;
public static T2IRegisteredParam<Image> InitImage, MaskImage, VideoEndFrame;
public static T2IRegisteredParam<AudioFile> VideoAudioInput, VideoAudioReference;
public static T2IRegisteredParam<T2IModel> Model, RefinerModel, VAE, RegionalObjectInpaintingModel, SegmentModel, VideoModel, VideoSwapModel, RefinerVAE, ClipLModel, ClipGModel, ClipVisionModel, T5XXLModel, LLaVAModel, LLaMAModel, QwenModel, MistralModel, GemmaModel, GptOssModel, VideoExtendModel, VideoExtendSwapModel, NegativeModel;
Expand Down Expand Up @@ -906,6 +906,9 @@ static bool isUncondName(string str)
RemoveBackground = Register<bool>(new("Remove Background", "If enabled, removes the background from the generated image.\nThis internally uses RemBG.",
"false", IgnoreIf: "false", IsAdvanced: true, Group: GroupAdvancedSampling, OrderPriority: -2
));
ConditioningMultiplier = Register<double>(new("Conditioning (Multiply)", "Multiplies the text conditioning.",
"1", Min: -100, Max: 100, Step: 0.01, Toggleable: true, IsAdvanced: true, Group: GroupAdvancedSampling, OrderPriority: -1
));
EndStepsEarly = Register<double>(new("End Steps Early", "Percentage of steps to cut off before the image is done generation.",
"0", Toggleable: true, IgnoreIf: "0", VisibleNormally: false, Min: 0, Max: 1, Group: GroupAdvancedSampling, FeatureFlag: "endstepsearly"
));
Expand Down
Loading