Skip to content

Commit b7bd543

Browse files
committed
preemptive code in workflow gen for SD3
1 parent 593a8d8 commit b7bd543

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/BuiltinExtensions/ComfyUIBackend/WorkflowGenerator.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,13 @@ public bool IsCascade()
12681268
return clazz is not null && clazz == "stable-cascade-v1";
12691269
}
12701270

1271+
/// <summary>Returns true if the current model is Stable Diffusion 3.</summary>
1272+
public bool IsSD3()
1273+
{
1274+
string clazz = CurrentCompatClass();
1275+
return clazz is not null && clazz == "stable-diffusion-v3-medium";
1276+
}
1277+
12711278
/// <summary>Gets a dynamic ID within a semi-stable registration set.</summary>
12721279
public string GetStableDynamicID(int index, int offset)
12731280
{
@@ -1806,6 +1813,15 @@ public string CreateEmptyImage(int width, int height, int batchSize, string id =
18061813
["width"] = width
18071814
}, id);
18081815
}
1816+
else if (IsSD3())
1817+
{
1818+
return CreateNode("EmptySD3LatentImage", new JObject()
1819+
{
1820+
["batch_size"] = batchSize,
1821+
["height"] = height,
1822+
["width"] = width
1823+
}, id);
1824+
}
18091825
else if (UserInput.Get(ComfyUIBackendExtension.ShiftedLatentAverageInit, false))
18101826
{
18111827
double offA = 0, offB = 0, offC = 0, offD = 0;

0 commit comments

Comments
 (0)