├── __init__.py ├── README.md ├── pyproject.toml ├── .github └── workflows │ └── publish.yml └── node.py /__init__.py: -------------------------------------------------------------------------------- 1 | from .node import NODE_CLASS_MAPPINGS 2 | __all__ = ['NODE_CLASS_MAPPINGS'] 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ComfyUI-HyperSDXL1StepUnetScheduler 2 | ComfyUI sampler for HyperSDXL UNet 3 | 4 | Ported from: 5 | https://huggingface.co/ByteDance/Hyper-SD/blob/main/comfyui/ComfyUI-HyperSDXL1StepUnetScheduler/node.py 6 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "comfyui-hypersdxl1stepunetscheduler" 3 | description = "Original author is ByteDance.\nComfyUI sampler for HyperSDXL UNet\nPorted from: [a/https://huggingface.co/ByteDance/Hyper-SD](https://huggingface.co/ByteDance/Hyper-SD)" 4 | version = "1.0.0" 5 | license = "LICENSE" 6 | 7 | [project.urls] 8 | Repository = "https://github.com/fofr/ComfyUI-HyperSDXL1StepUnetScheduler" 9 | # Used by Comfy Registry https://comfyregistry.org 10 | 11 | [tool.comfy] 12 | PublisherId = "fofr" 13 | DisplayName = "ComfyUI-HyperSDXL1StepUnetScheduler" 14 | Icon = "" 15 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish to Comfy registry 2 | on: 3 | workflow_dispatch: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - "pyproject.toml" 9 | 10 | jobs: 11 | publish-node: 12 | name: Publish Custom Node to registry 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Check out code 16 | uses: actions/checkout@v4 17 | - name: Publish Custom Node 18 | uses: Comfy-Org/publish-node-action@main 19 | with: 20 | ## Add your own personal access token to your Github Repository secrets and reference it here. 21 | personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }} -------------------------------------------------------------------------------- /node.py: -------------------------------------------------------------------------------- 1 | # Ported from 2 | # https://huggingface.co/ByteDance/Hyper-SD/blob/main/comfyui/ComfyUI-HyperSDXL1StepUnetScheduler/node.py 3 | 4 | import comfy.samplers 5 | import comfy.sample 6 | from comfy.k_diffusion import sampling as k_diffusion_sampling 7 | import latent_preview 8 | import torch 9 | import comfy.utils 10 | 11 | 12 | class HyperSDXL1StepUnetScheduler: 13 | @classmethod 14 | def INPUT_TYPES(s): 15 | return { 16 | "required": { 17 | "model": ("MODEL",), 18 | "steps": ("INT", {"default": 1, "min": 1, "max": 10}), 19 | } 20 | } 21 | 22 | RETURN_TYPES = ("SIGMAS",) 23 | CATEGORY = "sampling/custom_sampling/schedulers" 24 | 25 | FUNCTION = "get_sigmas" 26 | 27 | def get_sigmas(self, model, steps): 28 | timesteps = torch.tensor([800]) 29 | sigmas = model.model.model_sampling.sigma(timesteps) 30 | sigmas = torch.cat([sigmas, sigmas.new_zeros([1])]) 31 | return (sigmas,) 32 | 33 | 34 | NODE_CLASS_MAPPINGS = { 35 | "HyperSDXL1StepUnetScheduler": HyperSDXL1StepUnetScheduler, 36 | } 37 | --------------------------------------------------------------------------------