mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-03 12:57:25 +08:00
PiD: Add SDXL and QwenImage (#14240)
Some checks are pending
Detect Unreviewed Merge / detect (push) Waiting to run
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Waiting to run
Execution Tests / test (macos-latest) (push) Waiting to run
Execution Tests / test (ubuntu-latest) (push) Waiting to run
Execution Tests / test (windows-latest) (push) Waiting to run
Test server launches without errors / test (push) Waiting to run
Unit Tests / test (macos-latest) (push) Waiting to run
Unit Tests / test (ubuntu-latest) (push) Waiting to run
Unit Tests / test (windows-2022) (push) Waiting to run
Some checks are pending
Detect Unreviewed Merge / detect (push) Waiting to run
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Waiting to run
Execution Tests / test (macos-latest) (push) Waiting to run
Execution Tests / test (ubuntu-latest) (push) Waiting to run
Execution Tests / test (windows-latest) (push) Waiting to run
Test server launches without errors / test (push) Waiting to run
Unit Tests / test (macos-latest) (push) Waiting to run
Unit Tests / test (ubuntu-latest) (push) Waiting to run
Unit Tests / test (windows-2022) (push) Waiting to run
This commit is contained in:
parent
e9207aa7cc
commit
dc10c0133e
@ -21,8 +21,8 @@ class PiDConditioning(io.ComfyNode):
|
|||||||
inputs=[
|
inputs=[
|
||||||
io.Conditioning.Input("positive"),
|
io.Conditioning.Input("positive"),
|
||||||
io.Latent.Input("latent", tooltip="latent (from VAEEncode or a KSampler)."),
|
io.Latent.Input("latent", tooltip="latent (from VAEEncode or a KSampler)."),
|
||||||
io.Combo.Input("latent_format", options=["flux", "sd3"], default="flux",
|
io.Combo.Input("latent_format", options=["flux", "sd3", "sdxl", "qwenimage"], default="flux",
|
||||||
tooltip="Flux1 and Flux2 latents auto-detected from channel dim, sd3 has to be selected manually."),
|
tooltip="Flux1 (16-ch) and Flux2 (128-ch) latents are auto-detected from channel dim under 'flux'. For SD3 (16-ch), SDXL (4-ch), or QwenImage (16-ch), select manually."),
|
||||||
io.Float.Input(
|
io.Float.Input(
|
||||||
"degrade_sigma", default=0.0, min=0.0, max=1.0, step=0.01,
|
"degrade_sigma", default=0.0, min=0.0, max=1.0, step=0.01,
|
||||||
tooltip="0 = clean latent. Increase to denoise corrupted latent outputs.",
|
tooltip="0 = clean latent. Increase to denoise corrupted latent outputs.",
|
||||||
@ -36,9 +36,17 @@ class PiDConditioning(io.ComfyNode):
|
|||||||
samples = latent["samples"]
|
samples = latent["samples"]
|
||||||
if latent_format == "flux":
|
if latent_format == "flux":
|
||||||
fmt_cls = comfy.latent_formats.Flux2 if samples.shape[1] == 128 else comfy.latent_formats.Flux
|
fmt_cls = comfy.latent_formats.Flux2 if samples.shape[1] == 128 else comfy.latent_formats.Flux
|
||||||
else:
|
elif latent_format == "sd3":
|
||||||
fmt_cls = comfy.latent_formats.SD3
|
fmt_cls = comfy.latent_formats.SD3
|
||||||
|
elif latent_format == "sdxl":
|
||||||
|
fmt_cls = comfy.latent_formats.SDXL
|
||||||
|
elif latent_format == "qwenimage":
|
||||||
|
fmt_cls = comfy.latent_formats.Wan21
|
||||||
|
else:
|
||||||
|
raise ValueError(f"Unknown latent_format: {latent_format}")
|
||||||
lq_latent = fmt_cls().process_in(samples)
|
lq_latent = fmt_cls().process_in(samples)
|
||||||
|
if lq_latent.ndim == 5:
|
||||||
|
lq_latent = lq_latent[:, :, 0]
|
||||||
sigma_t = torch.tensor([float(degrade_sigma)], dtype=torch.float32)
|
sigma_t = torch.tensor([float(degrade_sigma)], dtype=torch.float32)
|
||||||
return io.NodeOutput(node_helpers.conditioning_set_values(
|
return io.NodeOutput(node_helpers.conditioning_set_values(
|
||||||
positive, {"lq_latent": lq_latent, "degrade_sigma": sigma_t},
|
positive, {"lq_latent": lq_latent, "degrade_sigma": sigma_t},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user