Skip to content

Commit

Permalink
preemptive code in workflow gen for SD3
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 4, 2024
1 parent 593a8d8 commit b7bd543
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/BuiltinExtensions/ComfyUIBackend/WorkflowGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,13 @@ public bool IsCascade()
return clazz is not null && clazz == "stable-cascade-v1";
}

/// <summary>Returns true if the current model is Stable Diffusion 3.</summary>
public bool IsSD3()
{
string clazz = CurrentCompatClass();
return clazz is not null && clazz == "stable-diffusion-v3-medium";
}

/// <summary>Gets a dynamic ID within a semi-stable registration set.</summary>
public string GetStableDynamicID(int index, int offset)
{
Expand Down Expand Up @@ -1806,6 +1813,15 @@ public string CreateEmptyImage(int width, int height, int batchSize, string id =
["width"] = width
}, id);
}
else if (IsSD3())
{
return CreateNode("EmptySD3LatentImage", new JObject()
{
["batch_size"] = batchSize,
["height"] = height,
["width"] = width
}, id);
}
else if (UserInput.Get(ComfyUIBackendExtension.ShiftedLatentAverageInit, false))
{
double offA = 0, offB = 0, offC = 0, offD = 0;
Expand Down

0 comments on commit b7bd543

Please sign in to comment.