| 5 | |
| 6 | @comfy_node(name="Set VAE Decoder Noise") |
| 7 | class DecoderNoise: |
| 8 | @classmethod |
| 9 | def INPUT_TYPES(cls): |
| 10 | return { |
| 11 | "required": { |
| 12 | "vae": ("VAE",), |
| 13 | "timestep": ( |
| 14 | "FLOAT", |
| 15 | { |
| 16 | "default": 0.05, |
| 17 | "min": 0.0, |
| 18 | "max": 1.0, |
| 19 | "step": 0.001, |
| 20 | "tooltip": "The timestep used for decoding the noise.", |
| 21 | }, |
| 22 | ), |
| 23 | "scale": ( |
| 24 | "FLOAT", |
| 25 | { |
| 26 | "default": 0.025, |
| 27 | "min": 0.0, |
| 28 | "max": 1.0, |
| 29 | "step": 0.001, |
| 30 | "tooltip": "The scale of the noise added to the decoder.", |
| 31 | }, |
| 32 | ), |
| 33 | "seed": ( |
| 34 | "INT", |
| 35 | { |
| 36 | "default": 42, |
| 37 | "min": 0, |
| 38 | "max": 0xFFFFFFFFFFFFFFFF, |
| 39 | "tooltip": "The random seed used for creating the noise.", |
| 40 | }, |
| 41 | ), |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | FUNCTION = "add_noise" |
| 46 | RETURN_TYPES = ("VAE",) |
| 47 | CATEGORY = "lightricks/LTXV" |
| 48 | |
| 49 | def add_noise(self, vae, timestep, scale, seed): |
| 50 | result = copy(vae) |
| 51 | if hasattr(result, "first_stage_model"): |
| 52 | result.first_stage_model.decode_timestep = timestep |
| 53 | result.first_stage_model.decode_noise_scale = scale |
| 54 | result._decode_timestep = timestep |
| 55 | result.decode_noise_scale = scale |
| 56 | result.seed = seed |
| 57 | return (result,) |
nothing calls this directly
no outgoing calls
no test coverage detected