Skip to content
Merged
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
11 changes: 8 additions & 3 deletions invokeai/app/invocations/z_image_denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
title="Denoise - Z-Image",
tags=["image", "z-image"],
category="image",
version="1.3.0",
version="1.4.0",
classification=Classification.Prototype,
)
class ZImageDenoiseInvocation(BaseInvocation):
Expand All @@ -69,6 +69,7 @@ class ZImageDenoiseInvocation(BaseInvocation):
)
denoising_start: float = InputField(default=0.0, ge=0, le=1, description=FieldDescriptions.denoising_start)
denoising_end: float = InputField(default=1.0, ge=0, le=1, description=FieldDescriptions.denoising_end)
add_noise: bool = InputField(default=True, description="Add noise based on denoising start.")
transformer: TransformerField = InputField(
description=FieldDescriptions.z_image_model, input=Input.Connection, title="Transformer"
)
Expand Down Expand Up @@ -347,8 +348,12 @@ def _run_diffusion(self, context: InvocationContext) -> torch.Tensor:

# Prepare input latent image
if init_latents is not None:
s_0 = sigmas[0]
latents = s_0 * noise + (1.0 - s_0) * init_latents
if self.add_noise:
# Noise the init_latents by the appropriate amount for the first timestep.
s_0 = sigmas[0]
latents = s_0 * noise + (1.0 - s_0) * init_latents
else:
latents = init_latents
else:
if self.denoising_start > 1e-5:
raise ValueError("denoising_start should be 0 when initial latents are not provided.")
Expand Down
12 changes: 12 additions & 0 deletions invokeai/frontend/web/src/services/api/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25587,6 +25587,12 @@ export type components = {
* @default 1
*/
denoising_end?: number;
/**
* Add Noise
* @description Add noise based on denoising start.
* @default true
*/
add_noise?: boolean;
/**
* Transformer
* @description Z-Image model (Transformer) to load
Expand Down Expand Up @@ -25708,6 +25714,12 @@ export type components = {
* @default 1
*/
denoising_end?: number;
/**
* Add Noise
* @description Add noise based on denoising start.
* @default true
*/
add_noise?: boolean;
/**
* Transformer
* @description Z-Image model (Transformer) to load
Expand Down