raubatz/1bucket / comfy /custom_nodes /ComfyUI-post-processing-nodes-master /post_processing /parabolize.py
| import torch | |
| class Parabolize: | |
| def __init__(self): | |
| pass | |
| def INPUT_TYPES(cls): | |
| return { | |
| "required": { | |
| "image": ("IMAGE",), | |
| "coeff": ("FLOAT", { | |
| "default": 1.0, | |
| "min": -10.0, | |
| "max": 10.0, | |
| "step": 0.1 | |
| }), | |
| "vertex_x": ("FLOAT", { | |
| "default": 0.5, | |
| "min": 0.0, | |
| "max": 1.0, | |
| "step": 0.1 | |
| }), | |
| "vertex_y": ("FLOAT", { | |
| "default": 0.5, | |
| "min": 0.0, | |
| "max": 1.0, | |
| "step": 0.1 | |
| }), | |
| }, | |
| } | |
| RETURN_TYPES = ("IMAGE",) | |
| FUNCTION = "parabolize_image" | |
| CATEGORY = "postprocessing/Color Adjustments" | |
| def parabolize_image(self, image: torch.Tensor, coeff: float, vertex_x: float, vertex_y: float): | |
| parabolized_image = coeff * torch.pow(image - vertex_x, 2) + vertex_y | |
| parabolized_image = torch.clamp(parabolized_image, 0, 1) | |
| return (parabolized_image,) | |
| NODE_CLASS_MAPPINGS = { | |
| "Parabolize": Parabolize, | |
| } | |
Xet Storage Details
- Size:
- 1.29 kB
- Xet hash:
- 74df8e0dd051aeb9bbcb7559b954488a68fb549cbee76ba82ac45d3d0d932c11
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.