allow cascade (B) as a refiner

for #117
This commit is contained in:
Alex "mcmonkey" Goodwin
2024-09-14 21:44:53 +09:00
parent 4fb537dc4c
commit 82f28c4a3d
2 changed files with 7 additions and 2 deletions

View File

@@ -774,7 +774,7 @@ public class WorkflowGenerator
public string DefaultPreviews = "default";
/// <summary>Creates a KSampler and returns its node ID.</summary>
public string CreateKSampler(JArray model, JArray pos, JArray neg, JArray latent, double cfg, int steps, int startStep, int endStep, long seed, bool returnWithLeftoverNoise, bool addNoise, double sigmin = -1, double sigmax = -1, string previews = null, string defsampler = null, string defscheduler = null, string id = null, bool rawSampler = false, bool doTiled = false)
public string CreateKSampler(JArray model, JArray pos, JArray neg, JArray latent, double cfg, int steps, int startStep, int endStep, long seed, bool returnWithLeftoverNoise, bool addNoise, double sigmin = -1, double sigmax = -1, string previews = null, string defsampler = null, string defscheduler = null, string id = null, bool rawSampler = false, bool doTiled = false, bool isFirstSampler = false)
{
bool willCascadeFix = false;
JArray cascadeModel = null;
@@ -784,6 +784,11 @@ public class WorkflowGenerator
willCascadeFix = true;
defsampler ??= "euler_ancestral";
defscheduler ??= "simple";
if (!isFirstSampler)
{
willCascadeFix = false;
model = cascadeModel;
}
}
if (IsFlux())
{

View File

@@ -866,7 +866,7 @@ public class WorkflowGeneratorSteps
else
{
g.CreateKSampler(g.FinalModel, g.FinalPrompt, g.FinalNegativePrompt, g.FinalLatentImage, cfg, steps, startStep, endStep,
g.UserInput.Get(T2IParamTypes.Seed), g.UserInput.Get(T2IParamTypes.RefinerMethod, "none") == "StepSwapNoisy", g.MainSamplerAddNoise, id: "10");
g.UserInput.Get(T2IParamTypes.Seed), g.UserInput.Get(T2IParamTypes.RefinerMethod, "none") == "StepSwapNoisy", g.MainSamplerAddNoise, id: "10", isFirstSampler: true);
if (g.UserInput.Get(T2IParamTypes.UseReferenceOnly, false))
{
string fromBatch = g.CreateNode("LatentFromBatch", new JObject()