├── standalone ├── mock │ ├── folder_paths.py │ └── comfy │ │ ├── model_patcher.py │ │ ├── model_management.py │ │ └── sd.py └── generate_loras.py ├── assets ├── pose.jpg ├── id-01.png ├── id-02.png ├── id-03.png ├── id-04.png ├── overview.jpg ├── ref-kps.png ├── slider0.png ├── slider1.png ├── T2I-Edit-01.jpg ├── T2I-Edit-02.jpg ├── T2I-Edit-03.jpg ├── T2I-Edit-04.jpg ├── T2I-LeoSams.jpg ├── HyperLoRA-T2I.jpg ├── T2I-ArienMixXL.jpg ├── T2I-RealVisXL.jpg ├── T2I-CyberRealXL.jpg ├── HyperLoRA-T2I-ControlNet.jpg ├── HyperLoRA-T2I-InstantID.jpg ├── HyperLoRA-T2I-FaceDetailer.jpg ├── HyperLoRA-T2I-ConceptSlider.jpg ├── HyperLoRA-T2I.json ├── HyperLoRA-T2I-ControlNet.json ├── HyperLoRA-T2I-FaceDetailer.json ├── HyperLoRA-T2I-InstantID.json └── HyperLoRA-T2I-ConceptSlider.json ├── requirements.txt ├── .gitignore ├── pyproject.toml ├── .github └── workflows │ └── publish.yml ├── __init__.py ├── hyperlora ├── node_fields.py ├── configs.py ├── common.py ├── modules.py └── nodes.py ├── README.md └── LICENSE /standalone/mock/folder_paths.py: -------------------------------------------------------------------------------- 1 | models_dir = None 2 | -------------------------------------------------------------------------------- /standalone/mock/comfy/model_patcher.py: -------------------------------------------------------------------------------- 1 | class ModelPatcher: 2 | pass 3 | -------------------------------------------------------------------------------- /assets/pose.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/pose.jpg -------------------------------------------------------------------------------- /assets/id-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/id-01.png -------------------------------------------------------------------------------- /assets/id-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/id-02.png -------------------------------------------------------------------------------- /assets/id-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/id-03.png -------------------------------------------------------------------------------- /assets/id-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/id-04.png -------------------------------------------------------------------------------- /assets/overview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/overview.jpg -------------------------------------------------------------------------------- /assets/ref-kps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/ref-kps.png -------------------------------------------------------------------------------- /assets/slider0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/slider0.png -------------------------------------------------------------------------------- /assets/slider1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/slider1.png -------------------------------------------------------------------------------- /assets/T2I-Edit-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/T2I-Edit-01.jpg -------------------------------------------------------------------------------- /assets/T2I-Edit-02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/T2I-Edit-02.jpg -------------------------------------------------------------------------------- /assets/T2I-Edit-03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/T2I-Edit-03.jpg -------------------------------------------------------------------------------- /assets/T2I-Edit-04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/T2I-Edit-04.jpg -------------------------------------------------------------------------------- /assets/T2I-LeoSams.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/T2I-LeoSams.jpg -------------------------------------------------------------------------------- /assets/HyperLoRA-T2I.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/HyperLoRA-T2I.jpg -------------------------------------------------------------------------------- /assets/T2I-ArienMixXL.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/T2I-ArienMixXL.jpg -------------------------------------------------------------------------------- /assets/T2I-RealVisXL.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/T2I-RealVisXL.jpg -------------------------------------------------------------------------------- /assets/T2I-CyberRealXL.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/T2I-CyberRealXL.jpg -------------------------------------------------------------------------------- /standalone/mock/comfy/model_management.py: -------------------------------------------------------------------------------- 1 | device = None 2 | 3 | def get_torch_device(): 4 | return device 5 | -------------------------------------------------------------------------------- /assets/HyperLoRA-T2I-ControlNet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/HyperLoRA-T2I-ControlNet.jpg -------------------------------------------------------------------------------- /assets/HyperLoRA-T2I-InstantID.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/HyperLoRA-T2I-InstantID.jpg -------------------------------------------------------------------------------- /assets/HyperLoRA-T2I-FaceDetailer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/HyperLoRA-T2I-FaceDetailer.jpg -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | diffusers>=0.26.3 2 | insightface>=0.7.3 3 | onnxruntime>=1.17.1 4 | opencv-python>=4.9.0.80 5 | transformers>=4.38.1 6 | -------------------------------------------------------------------------------- /standalone/mock/comfy/sd.py: -------------------------------------------------------------------------------- 1 | def load_lora_for_models(model, clip, lora, strength_model, strength_clip): 2 | return (model, clip) 3 | -------------------------------------------------------------------------------- /assets/HyperLoRA-T2I-ConceptSlider.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bytedance/ComfyUI-HyperLoRA/HEAD/assets/HyperLoRA-T2I-ConceptSlider.jpg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | .tmp/ 3 | .bak/ 4 | __pycache__/ 5 | log/ 6 | logs/ 7 | 8 | *.pyc 9 | *.pyd 10 | *.log 11 | *.png 12 | *.jpg 13 | *.mp4 14 | *.pth 15 | *.pt 16 | *.bin 17 | *.safetensors 18 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "hyperlora" 3 | description = "Official implementation in ComfyUI of CVPR 2025 paper 'HyperLoRA: Parameter-Efficient Adaptive Generation for Portrait Synthesis'" 4 | version = "1.0.0" 5 | license = {file = "LICENSE"} 6 | dependencies = ["diffusers>=0.26.3", "insightface>=0.7.3", "onnxruntime>=1.17.1", "opencv-python>=4.9.0.80", "transformers>=4.38.1"] 7 | 8 | [project.urls] 9 | Repository = "https://github.com/bytedance/ComfyUI-HyperLoRA" 10 | # Used by Comfy Registry https://comfyregistry.org 11 | 12 | [tool.comfy] 13 | PublisherId = "lemonsky" 14 | DisplayName = "ComfyUI-HyperLoRA" 15 | Icon = "" 16 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish to Comfy registry 2 | on: 3 | workflow_dispatch: 4 | push: 5 | branches: 6 | - main 7 | - master 8 | paths: 9 | - "pyproject.toml" 10 | 11 | permissions: 12 | issues: write 13 | 14 | jobs: 15 | publish-node: 16 | name: Publish Custom Node to registry 17 | runs-on: ubuntu-latest 18 | if: ${{ github.repository_owner == 'bytedance' }} 19 | steps: 20 | - name: Check out code 21 | uses: actions/checkout@v4 22 | with: 23 | submodules: true 24 | - name: Publish Custom Node 25 | uses: Comfy-Org/publish-node-action@v1 26 | with: 27 | ## Add your own personal access token to your Github Repository secrets and reference it here. 28 | personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }} 29 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025 Bytedance Ltd. and/or its affiliates. All rights reserved. 2 | 3 | # Licensed under the GNU General Public License, Version 3.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | 7 | # https://www.gnu.org/licenses/gpl-3.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from .hyperlora.nodes import HYPER_LORA_CLASS_MAPPINGS, HYPER_LORA_DISPLAY_NAME_MAPPINGS 16 | 17 | 18 | NODE_CLASS_MAPPINGS = { 19 | **HYPER_LORA_CLASS_MAPPINGS 20 | } 21 | 22 | NODE_DISPLAY_NAME_MAPPINGS = { 23 | **HYPER_LORA_DISPLAY_NAME_MAPPINGS 24 | } 25 | -------------------------------------------------------------------------------- /standalone/generate_loras.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import os 3 | import sys 4 | from PIL import Image 5 | from safetensors.torch import save_file 6 | 7 | mock_path = os.path.join(os.path.dirname(__file__), 'mock') 8 | print(f'Add mock path {mock_path} to sys.path') 9 | sys.path.append(mock_path) 10 | 11 | from hyperlora.common import images2tensor 12 | from hyperlora.nodes import HyperLoRAUniLoaderNode, HyperLoRAUniGenerateIDLoRANode 13 | 14 | 15 | if __name__ == '__main__': 16 | parser = argparse.ArgumentParser(description='HyperLoRA testing script') 17 | parser.add_argument('--models_dir', type=str, required=True) 18 | parser.add_argument('--indir', type=str, required=True) 19 | parser.add_argument('--outdir', type=str, required=True) 20 | parser.add_argument('--image_processor', type=str, default='clip_vit_large_14_processor') 21 | parser.add_argument('--image_encoder', type=str, default='clip_vit_large_14') 22 | parser.add_argument('--encoder_types', type=str, default='clip + arcface') 23 | parser.add_argument('--face_analyzer', type=str, default='antelopev2') 24 | parser.add_argument('--model', type=str, default='sdxl_hyper_id_lora_v1_fidelity') 25 | parser.add_argument('--dtype', type=str, default='fp16') 26 | parser.add_argument('--device', type=str, default='cuda') 27 | args = parser.parse_args() 28 | 29 | import folder_paths 30 | from comfy import model_management 31 | folder_paths.models_dir = args.models_dir 32 | model_management.device = args.device 33 | 34 | HyperLoRAUniLoaderNode.INPUT_TYPES() 35 | HyperLoRAUniGenerateIDLoRANode.INPUT_TYPES() 36 | loader_node = HyperLoRAUniLoaderNode() 37 | gen_node = HyperLoRAUniGenerateIDLoRANode() 38 | hyper_lora, = loader_node.execute(args.image_processor, args.image_encoder, args.encoder_types, args.face_analyzer, args.model, args.dtype) 39 | 40 | image_files = [ fn for fn in os.listdir(args.indir) if os.path.splitext(fn)[1].lower() in [ '.jpg', '.jpeg', '.png' ] ] 41 | os.makedirs(args.outdir, exist_ok=True) 42 | for fn in image_files: 43 | try: 44 | lora, = gen_node.execute(hyper_lora, images2tensor([ Image.open(os.path.join(args.indir, fn)).convert('RGB') ]), False, True) 45 | save_file(lora, os.path.join(args.outdir, os.path.splitext(fn)[0] + '.safetensors')) 46 | print(f'Processed {fn}') 47 | except Exception as e: 48 | print(f'Failed to process {fn}, error: {e}') 49 | -------------------------------------------------------------------------------- /hyperlora/node_fields.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025 Bytedance Ltd. and/or its affiliates. All rights reserved. 2 | 3 | # Licensed under the GNU General Public License, Version 3.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | 7 | # https://www.gnu.org/licenses/gpl-3.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from typing import Dict, Iterable, Tuple 16 | 17 | 18 | def inputs_def(required: Iterable = [], optional: Iterable = []) -> Dict[str, Dict]: 19 | return { 20 | 'required': { 21 | k: v for k, v in required 22 | }, 23 | 'optional': { 24 | k: v for k, v in optional 25 | } 26 | } 27 | 28 | def image_field(name: str = 'image') -> Tuple[str, Tuple]: 29 | return name, ('IMAGE', ) 30 | 31 | def mask_field(name: str = 'mask') -> Tuple[str, Tuple]: 32 | return name, ('MASK', ) 33 | 34 | def custom_field(name: str = 'custom', type_name: str = 'CUSTOM') -> Tuple[str, Tuple]: 35 | return name, (type_name, ) 36 | 37 | def enum_field(name: str = 'enum_field', options: Iterable = []) -> Tuple[str, Tuple]: 38 | return name, (options, ) 39 | 40 | def int_field(name: str = 'int_field', default: int = 50, minimum: int = 0, maximum: int = 100, step: int = 1) -> Tuple[str, Tuple]: 41 | return name, ('INT', { 42 | 'default': default, 43 | 'min': minimum, 44 | 'max': maximum, 45 | 'step': step, 46 | 'display': 'number' 47 | }) 48 | 49 | def float_field(name: str = 'float_field', default: float = 0.5, minimum: float = 0.0, maximum: float = 1.0, step: float = 0.1) -> Tuple[str, Tuple]: 50 | return name, ('FLOAT', { 51 | 'default': default, 52 | 'min': minimum, 53 | 'max': maximum, 54 | 'step': step, 55 | 'round': step, 56 | 'display': 'number' 57 | }) 58 | 59 | def str_field(name: str = 'str_field', default: str = '', multiline: bool = False) -> Tuple[str, Tuple]: 60 | return name, ('STRING', { 61 | 'default': default, 62 | 'multiline': multiline 63 | }) 64 | 65 | def bool_field(name: str = 'bool_field', default: bool = False) -> Tuple[str, Tuple]: 66 | return name, ('BOOLEAN', { 67 | 'default': default 68 | }) 69 | -------------------------------------------------------------------------------- /hyperlora/configs.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025 Bytedance Ltd. and/or its affiliates. All rights reserved. 2 | 3 | # Licensed under the GNU General Public License, Version 3.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | 7 | # https://www.gnu.org/licenses/gpl-3.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from dataclasses import dataclass, field 16 | from transformers import CLIPVisionModelWithProjection, CLIPImageProcessor 17 | from typing import Dict, Any, List, Literal 18 | 19 | 20 | @dataclass 21 | class BaseConfig: 22 | def from_dict(self, config_dict: Dict[str, Any]): 23 | for key, value in config_dict.items(): 24 | if not hasattr(self, key): 25 | print(f'Ignoring unknown key "{key}"') 26 | continue 27 | default_value = getattr(self, key) 28 | if isinstance(default_value, BaseConfig): 29 | default_value.from_dict(value) 30 | elif not default_value == value: 31 | print(f'Value of key "{key}" was changed from "{default_value}" to "{value}"') 32 | setattr(self, key, value) 33 | 34 | def print(self, indent: int = 0): 35 | for key, value in vars(self).items(): 36 | if isinstance(value, BaseConfig): 37 | print(f'{" " * indent}{key}:') 38 | value.print(indent + 2) 39 | else: 40 | print(f'{" " * indent}{key}: {value}') 41 | 42 | def instantiate(self): 43 | pass 44 | 45 | 46 | @dataclass 47 | class BaseImageEncoderConfig(BaseConfig): 48 | pretrained_model: str = None 49 | 50 | def instantiate(self): 51 | assert not self.pretrained_model is None 52 | return CLIPVisionModelWithProjection.from_pretrained(self.pretrained_model) 53 | 54 | 55 | @dataclass 56 | class BaseImageProcessorConfig(BaseConfig): 57 | pretrained_model: str = None 58 | 59 | def instantiate(self): 60 | assert not self.pretrained_model is None 61 | return CLIPImageProcessor.from_pretrained(self.pretrained_model) 62 | 63 | 64 | @dataclass 65 | class ResamplerConfig(BaseConfig): 66 | dim: int = 1024 67 | dim_head: int = 64 68 | heads: int = 12 69 | depth: int = 4 70 | ff_mult: int = 4 71 | 72 | 73 | @dataclass 74 | class HyperLoRAConfig(BaseConfig): 75 | image_processor: BaseImageProcessorConfig = field(default_factory=lambda: BaseImageProcessorConfig()) 76 | image_encoder: BaseImageEncoderConfig = field(default_factory=lambda: BaseImageEncoderConfig()) 77 | resampler: ResamplerConfig = field(default_factory=lambda: ResamplerConfig()) 78 | 79 | encoder_types: List[Literal['clip', 'arcface']] = field(default_factory=lambda: ['clip']) 80 | 81 | face_analyzer: str = 'antelopev2' 82 | insightface_root: str = './' 83 | 84 | id_embed_dim: int = 512 85 | num_id_tokens: int = 4 86 | hyper_dim: int = 1024 87 | lora_rank: int = 4 88 | 89 | has_base_lora: bool = False 90 | -------------------------------------------------------------------------------- /hyperlora/common.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025 Bytedance Ltd. and/or its affiliates. All rights reserved. 2 | 3 | # Licensed under the GNU General Public License, Version 3.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | 7 | # https://www.gnu.org/licenses/gpl-3.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import base64 16 | import functools 17 | import io 18 | import itertools 19 | import requests 20 | import torch 21 | import numpy as np 22 | from enum import Enum 23 | from dataclasses import dataclass 24 | from PIL import Image 25 | from typing import Any, Callable, Dict, Iterable, List 26 | 27 | 28 | SD15_ATTN_DOWN_BLOCK_IDS = [ 1, 2, 4, 5, 7, 8 ] 29 | SD15_ATTN_UP_BLOCK_IDS = [ 3, 4, 5, 6, 7, 8, 9, 10, 11 ] 30 | 31 | SDXL_ATTN_DOWN_BLOCK_IDS = [ 32 | (4, 0), (4, 1), 33 | (5, 0), (5, 1), 34 | (7, 0), (7, 1), (7, 2), (7, 3), (7, 4), (7, 5), (7, 6), (7, 7), (7, 8), (7, 9), 35 | (8, 0), (8, 1), (8, 2), (8, 3), (8, 4), (8, 5), (8, 6), (8, 7), (8, 8), (8, 9) 36 | ] 37 | SDXL_ATTN_MID_BLOCK_IDS = [ 38 | (0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (0, 6), (0, 7), (0, 8), (0, 9) 39 | ] 40 | SDXL_ATTN_UP_BLOCK_IDS = [ 41 | (0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (0, 6), (0, 7), (0, 8), (0, 9), 42 | (1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (1, 7), (1, 8), (1, 9), 43 | (2, 0), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6), (2, 7), (2, 8), (2, 9), 44 | (3, 0), (3, 1), 45 | (4, 0), (4, 1), 46 | (5, 0), (5, 1) 47 | ] 48 | 49 | 50 | @dataclass 51 | class FaceAttrInfo: 52 | rect: np.ndarray 53 | landmarks: np.ndarray 54 | 55 | @dataclass 56 | class SmashResp: 57 | n_face: int 58 | w: int 59 | h: int 60 | 61 | @dataclass 62 | class FaceAttrResp(SmashResp): 63 | faces: List[FaceAttrInfo] 64 | 65 | 66 | class ResizeMode(Enum): 67 | LONG_EDGE = 0 68 | SHORT_EDGE = 1 69 | WIDTH = 2 70 | HEIGHT = 3 71 | 72 | class BatchType(Enum): 73 | TENSOR = 0 74 | LIST = 1 75 | 76 | 77 | def tensor2images(tensor: torch.Tensor) -> List[Image.Image]: 78 | images = [] 79 | for i in range(tensor.shape[0]): 80 | image = tensor[i].cpu().numpy() 81 | image = (image.clip(0.0, 1.0) * 255.0).astype(np.uint8) 82 | images.append(Image.fromarray(image)) 83 | return images 84 | 85 | def images2tensor(images: Iterable[Image.Image]) -> torch.Tensor: 86 | tensor_list = [] 87 | for image in images: 88 | image = np.array(image).astype(np.float32) / 255.0 89 | tensor_list.append(torch.from_numpy(image).unsqueeze(0)) 90 | return torch.cat(tensor_list, dim=0) 91 | 92 | def image2base64(image: Image.Image) -> str: 93 | with io.BytesIO() as f: 94 | image.save(f, format='PNG') 95 | img_bytes = f.getvalue() 96 | return str(base64.b64encode(img_bytes), encoding='utf-8') 97 | 98 | def image_from_url(url: str) -> Image.Image: 99 | return Image.open(requests.get(url, stream=True).raw) 100 | 101 | def resize_image(image: Image.Image, size: int, mode: ResizeMode = ResizeMode.LONG_EDGE) -> Image.Image: 102 | w, h = image.size 103 | if mode == ResizeMode.LONG_EDGE: 104 | scale = size / max(w, h) 105 | elif mode == ResizeMode.SHORT_EDGE: 106 | scale = size / min(w, h) 107 | elif mode == ResizeMode.WIDTH: 108 | scale = size / w 109 | elif mode == ResizeMode.HEIGHT: 110 | scale = size / h 111 | scale += 1e-5 112 | return image.resize((int(w * scale), int(h * scale)), Image.Resampling.BICUBIC if scale >= 1.0 else Image.Resampling.LANCZOS) 113 | 114 | def batch_proc(**arg_types: Dict[str, BatchType]): 115 | def wrapper(func: Callable): 116 | def worker(*args: List[Any], **kwargs: Dict[str, Any]) -> Any: 117 | # convert tensor to images and get max batch size 118 | max_bs = 0 119 | batch_args = {} 120 | for name, type in arg_types.items(): 121 | assert name in kwargs, f'{name} is not in kwargs' 122 | if type == BatchType.TENSOR: 123 | batch_args[name] = tensor2images(kwargs[name]) 124 | elif type == BatchType.LIST: 125 | batch_args[name] = kwargs[name] 126 | else: 127 | assert False, f'{type} is not supported' 128 | max_bs = max(max_bs, len(batch_args[name])) 129 | # check if all args have the same batch size or batch size is 1 130 | for name, type in arg_types.items(): 131 | if len(batch_args[name]) == max_bs: 132 | continue 133 | elif len(batch_args[name]) == 1: 134 | batch_args[name] = [ batch_args[name][0] for _ in range(max_bs) ] 135 | else: 136 | assert False, 'All args must have the same batch size or batch size is 1' 137 | # batch process 138 | batch_args_cnt = len(batch_args) 139 | outs = [] 140 | for items in zip(*map(functools.partial(itertools.repeat, times=max_bs), batch_args.keys()), *batch_args.values()): 141 | for name, value in zip(items[:batch_args_cnt], items[batch_args_cnt:]): 142 | kwargs[name] = value 143 | outs.append(func(*args, **kwargs)) 144 | # post process 145 | results = [] 146 | for items in zip(*outs): 147 | if isinstance(items[0], Image.Image): 148 | results.append(images2tensor(items)) 149 | else: 150 | results.append(list(items)) 151 | return tuple(results) 152 | return worker 153 | return wrapper 154 | -------------------------------------------------------------------------------- /hyperlora/modules.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025 Bytedance Ltd. and/or its affiliates. All rights reserved. 2 | 3 | # Licensed under the GNU General Public License, Version 3.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | 7 | # https://www.gnu.org/licenses/gpl-3.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import torch 16 | import torch.nn as nn 17 | from diffusers.models.attention import FeedForward 18 | from diffusers.models.attention_processor import Attention 19 | from typing import Tuple 20 | 21 | 22 | class PerceiverAttentionBlock(nn.Module): 23 | def __init__(self, dim, dim_head=64, heads=8, ff_mult=4, n_conds=1): 24 | super().__init__() 25 | 26 | self.norm_attn1 = nn.LayerNorm(dim) 27 | self.norm_attn2_l = nn.LayerNorm(dim) 28 | self.norm_attn2_x = nn.LayerNorm(dim) 29 | if n_conds == 2: 30 | self.norm_attn3_l = nn.LayerNorm(dim) 31 | self.norm_attn3_y = nn.LayerNorm(dim) 32 | self.norm_ff = nn.LayerNorm(dim) 33 | 34 | self.attn1 = Attention(query_dim=dim, cross_attention_dim=dim, heads=heads, dim_head=dim_head, out_bias=False) 35 | self.attn2 = Attention(query_dim=dim, cross_attention_dim=dim, heads=heads, dim_head=dim_head, out_bias=False) 36 | if n_conds == 2: 37 | self.attn3 = Attention(query_dim=dim, cross_attention_dim=dim, heads=heads, dim_head=dim_head, out_bias=False) 38 | self.ff = FeedForward(dim=dim, mult=ff_mult, activation_fn='gelu') 39 | 40 | def forward(self, x, latents, y=None): 41 | # attention 1 42 | norm_latents = self.norm_attn1(latents) 43 | latents = self.attn1(norm_latents, encoder_hidden_states=norm_latents) + latents 44 | 45 | # attention 2 46 | norm_latents = self.norm_attn2_l(latents) 47 | norm_x = self.norm_attn2_x(x) 48 | latents = self.attn2(norm_latents, encoder_hidden_states=norm_x) + latents 49 | 50 | # attention 3 51 | if not y is None: 52 | norm_latents = self.norm_attn3_l(latents) 53 | norm_y = self.norm_attn3_y(y) 54 | latents = self.attn3(norm_latents, encoder_hidden_states=norm_y) + latents 55 | 56 | # feed forward 57 | norm_latents = self.norm_ff(latents) 58 | latents = self.ff(norm_latents) + latents 59 | 60 | return latents 61 | 62 | 63 | class Resampler(nn.Module): 64 | def __init__(self, dim=1024, depth=8, dim_head=64, heads=8, num_queries=16, embedding_dim=768, output_dim=1024, ff_mult=4, n_conds=1): 65 | super().__init__() 66 | 67 | self.latents = nn.Parameter(torch.randn(1, num_queries, dim) / dim ** 0.5) 68 | self.proj_in = nn.Linear(embedding_dim, dim) 69 | self.proj_out = nn.Linear(dim, output_dim) 70 | 71 | self.layers = nn.ModuleList([ 72 | PerceiverAttentionBlock(dim=dim, dim_head=dim_head, heads=heads, ff_mult=ff_mult, n_conds=n_conds) 73 | for _ in range(depth) 74 | ]) 75 | 76 | if n_conds == 2: 77 | self.proj_in_2 = nn.Linear(embedding_dim, dim) 78 | 79 | def norm_out(self, x): 80 | return x * (x.pow(2.0).sum(dim=-1, keepdim=True) + 1e-8).rsqrt() 81 | 82 | def forward(self, x, y=None): 83 | latents = self.latents.repeat(x.shape[0], 1, 1) 84 | 85 | x = self.proj_in(x) 86 | if not y is None: 87 | y = self.proj_in_2(y) 88 | for layer in self.layers: 89 | latents = layer(x, latents, y) 90 | 91 | latents = self.proj_out(latents) 92 | latents = torch.mean(latents, dim=0, keepdim=True) # get mean latents across batch 93 | latents = self.norm_out(latents) 94 | 95 | return latents 96 | 97 | 98 | class HyperLoRALayer(nn.Module): 99 | def __init__(self, dim: int, in_features: int, out_features: int, lora_rank: int = 4, has_base_lora: bool = False): 100 | super().__init__() 101 | 102 | self.id_down_basis = nn.Parameter(torch.zeros(dim, in_features, lora_rank)) 103 | self.id_up_basis = nn.Parameter(torch.zeros(dim, lora_rank, out_features)) 104 | 105 | if has_base_lora: 106 | self.base_down_basis = nn.Parameter(torch.zeros(dim, in_features, lora_rank // 2)) 107 | self.base_up_basis = nn.Parameter(torch.zeros(dim, lora_rank // 2, out_features)) 108 | 109 | def linear_mix(self, coeffs: torch.Tensor, basis: torch.Tensor): 110 | return torch.einsum('bi, ijk -> bjk', coeffs, basis) 111 | 112 | def forward(self, tokens: torch.Tensor, mode='id'): 113 | down_coeffs, up_coeffs = tokens[:,0,:], tokens[:,1,:] 114 | if mode == 'id': 115 | down, up = self.linear_mix(down_coeffs, self.id_down_basis), self.linear_mix(up_coeffs, self.id_up_basis) 116 | elif mode == 'base': 117 | down, up = self.linear_mix(down_coeffs, self.base_down_basis), self.linear_mix(up_coeffs, self.base_up_basis) 118 | return down[0].t().contiguous(), up[0].t().contiguous() 119 | 120 | 121 | class HyperLoRAModule(nn.Module): 122 | def __init__(self, dim: int, hidden_size: int, cross_attention_dim: int, lora_rank: int = 4, has_base_lora: bool = False): 123 | super().__init__() 124 | 125 | self.to_q = HyperLoRALayer(dim, hidden_size, hidden_size, lora_rank=lora_rank, has_base_lora=has_base_lora) 126 | self.to_k = HyperLoRALayer(dim, cross_attention_dim or hidden_size, hidden_size, lora_rank=lora_rank, has_base_lora=has_base_lora) 127 | self.to_v = HyperLoRALayer(dim, cross_attention_dim or hidden_size, hidden_size, lora_rank=lora_rank, has_base_lora=has_base_lora) 128 | self.to_out = HyperLoRALayer(dim, hidden_size, hidden_size, lora_rank=lora_rank, has_base_lora=has_base_lora) 129 | 130 | def forward(self, tokens: torch.Tensor, mode='id'): 131 | q, k, v, out = tokens.chunk(4, dim=1) 132 | return { 133 | 'to_q': self.to_q(q, mode=mode), 134 | 'to_k': self.to_k(k, mode=mode), 135 | 'to_v': self.to_v(v, mode=mode), 136 | 'to_out_0': self.to_out(out, mode=mode) 137 | } 138 | 139 | 140 | class Reshape(nn.Module): 141 | def __init__(self, shape: Tuple[int]): 142 | super().__init__() 143 | self.shape = shape 144 | 145 | def forward(self, x: torch.Tensor): 146 | return x.reshape(*self.shape) 147 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #
HyperLoRA: Parameter-Efficient Adaptive Generation for Portrait Synthesis
2 |
3 | Mengtian Li*, 4 | Jinshu Chen*, 5 | Wanquan Feng*✉, 6 | Bingchuan Li, 7 | Fei Dai, 8 | Songtao Zhao, 9 | Qian He 10 |
11 | Intelligent Creation, ByteDance 12 |
13 |
14 |
15 | [Project Page] 16 | [ArXiv] 17 |
18 | 19 | ## Abstract 20 | Personalized portrait synthesis, essential in domains like social entertainment, has recently made significant progress. Person-wise fine-tuning based methods, such as LoRA and DreamBooth, can produce photorealistic outputs but need training on individual samples, consuming time and resources and posing an unstable risk. Adapter based techniques such as IP-Adapter freeze the foundational model parameters and employ a plug-in architecture to enable zero-shot inference, but they often exhibit a lack of naturalness and authenticity, which are not to be overlooked in portrait synthesis tasks. In this paper, we introduce a parameter-efficient adaptive generation method, namely HyperLoRA, that uses an adaptive plug-in network to generate LoRA weights, merging the superior performance of LoRA with the zero-shot capability of adapter scheme. Through our carefully designed network structure and training strategy, we achieve zero-shot personalized portrait generation (supporting both single and multiple image inputs) with high photorealism, fidelity, and editability. 21 | 22 | ## Overview 23 | ![](assets/overview.jpg) 24 | We explicitly decompose the HyperLoRA into a Hyper ID-LoRA and a Hyper Base-LoRA. The former is designed to learn ID information while the latter is expected to fit others, e.g. background and clothing. Such a design helps to prevent irreverent features leaking to ID-LoRA. During the training, we fix the weights of the pretrained SDXL base model and encoders, allowing only HyperLoRA modules updated by Backpropagation. At the inference stage, the Hyper ID-LoRA integrated into SDXL generates personalized images while the Hyper Base-LoRA is optional. 25 | 26 | ## Usage 27 | ### Create Model Folders 28 | Navigate to your ComfyUI's ```models``` folder and create the following subfolders: 29 | ``` 30 | models/ 31 | ├── hyper_lora/ 32 | │ ├── clip_processor/ # Directory for CLIP processor files 33 | │ │ └── clip_vit_large_14_processor/ # Specific CLIP Processor 34 | │ │ └── preprocessor_config.json 35 | │ ├── clip_vit/ # Directory for CLIP ViT model files 36 | │ │ └── clip_vit_large_14/ # Specific CLIP ViT model 37 | │ │ ├── config.json 38 | │ │ └── model.safetensors 39 | │ └── hyper_lora/ # Directory for HyperLoRA model files 40 | │ ├── sdxl_hyper_id_lora_v1_edit/ # HyperLoRA for editability 41 | │ │ ├── hyper_lora_modules.json 42 | │ │ ├── hyper_lora_modules.safetensors 43 | │ │ ├── id_projector.safetensors 44 | │ │ └── resampler.safetensors 45 | │ └── sdxl_hyper_id_lora_v1_fidelity/ # HyperLoRA for fidelity 46 | │ └── Same as above 47 | └── insightface/ 48 | └── models/ # Directory for InsightFace model files 49 | ``` 50 | 51 | ### Download Models 52 | First, download the [CLIP processor](https://huggingface.co/openai/clip-vit-large-patch14/raw/main/preprocessor_config.json) to ```models/hyper_lora/clip_processor/clip_vit_large_14_processor``` 53 | 54 | Second, download the [CLIP ViT model](https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/model.safetensors) and [config](https://huggingface.co/openai/clip-vit-large-patch14/raw/main/config.json) to ```models/hyper_lora/clip_vit/clip_vit_large_14``` 55 | 56 | Then, download the [antelopev2](https://github.com/deepinsight/insightface/tree/master/python-package#model-zoo) and unzip it to ```models/insightface/models``` 57 | 58 | Finally, download the [HyperLoRA model](https://huggingface.co/bytedance-research/HyperLoRA) to ```models/hyper_lora/hyper_lora``` 59 | 60 | We have released two versions of HyperLoRA. sdxl_hyper_id_lora_v1_fidelity offers better fidelity, while sdxl_hyper_id_lora_v1_edit provides better editability. Note that we trained for some additional steps using FP16 precision and distilled the 0.25x Base LoRA into the ID LoRA, which further reduced the model size and the GPU memory usage. 61 | 62 | ### Example Workflows 63 | The workflows depend on [ComfyUI_ADV_CLIP_emb](https://github.com/BlenderNeko/ComfyUI_ADV_CLIP_emb) and [ComfyUI-Impact-Pack](https://github.com/ltdrdata/ComfyUI-Impact-Pack) plugins. 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 |
NameWorkflowResult
T2IHyperLoRA-T2I.json
T2I + FaceDetailer🌟HyperLoRA-T2I-FaceDetailer.json
T2I + ControlNetHyperLoRA-T2I-ControlNet.json
T2I + InstantID🌟HyperLoRA-T2I-InstantID.json
T2I + ConceptSliderHyperLoRA-T2I-ConceptSlider.json
97 | 98 | *🌟 Recommended workflow* 99 | 100 | We fixed the random seed in all workflows so that the results can be fully reproduced. All the input images required by these workflows can be found in the ```assets``` folder. 101 | 102 | ### Non-ComfyUI User 103 | We also provide a standalone script to generate ID LoRAs, which works without ComfyUI. Please create model folders, download models, and run the following command. 104 | ```bash 105 | python3 standalone/generate_loras.py \ 106 | --models_dir \ 107 | --indir \ 108 | --outdir \ 109 | [--model {sdxl_hyper_id_lora_v1_fidelity|sdxl_hyper_id_lora_v1_edit}] \ 110 | [--dtype {fp16|bf16|fp32}] 111 | ``` 112 | 113 | ### Tips 114 | **IMPORTANT:** 115 | - Please confirm that all model and config files are placed in correct directories. 116 | - The text prompt should start with the LoRA trigger words `fcsks fxhks fhyks, ` to enable LoRA. 117 | - It is recommended to set `stop_at_clip_layer` to `-2` to align with our training config. 118 | 119 | HyperLoRA is not compatible with all SDXL base models. We have tested that it is compatible with [LEOSAM's HelloWorld XL 3.0](https://civitai.com/models/43977?modelVersionId=262973), [CyberRealistic XL v1.1](https://civitai.com/models/312530?modelVersionId=395041), and [RealVisXL v4.0](https://civitai.com/models/139562?modelVersionId=344487), but incompatible with [ArienMixXL v4.0](https://civitai.com/models/118913?modelVersionId=322265). Among them, RealVisXL v4.0 may achieve the best results. 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 |
LEOSAM 😊CyberRealistic 😊RealVis 😊ArienMix 😭
135 | 136 | The LoRA weight are usually around 0.75 to 0.85. If the prompt is very long, you can appropriately increase the weight (as well as the weight of trigger words). If better editability is required, you can appropriately decrease the weight. 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 |
SunglassesBabySketchSand Sculpture
152 | 153 | Due to the limited resolution of the trained faces, it is recommended to use a FaceDetailer plugin to repair small faces or use ControlNet to increase stability. In addition, combining HyperLoRA with the ControlNet of InstantID can usually further improve the facial similarity. 154 | 155 | When creating a Concept Slider using HyperLoRA, the paired images should ensure that only the edited attribute changes, while other attributes remain fixed (especially the ID and pose). Therefore, the best way is to render an animatable 3D human head. 156 | 157 | Furthermore, HyperLoRA can also provide a good initialization for LoRA training. You can obtain a better ID LoRA with only about 50 steps of finetuning. 158 | 159 | ## Disclaimer and Licenses 160 | Our code is under the GPL 3.0 license. You can use, modify, and distribute it, with derivative works also under GPL 3.0. Our models follow the CC BY-NC 4.0 license, allowing non-commercial sharing and adaptation with proper credit. Third-party models like SDXL, CLIP, and InsightFace are subject to their original licenses. 161 | 162 | This project aims to advance the field of generative AI. We disclaim any liability for misuse or unauthorized use of the code, models, or related materials. You must comply with all relevant licenses and laws when using this plugin. 163 | 164 | ## Citation 165 | If you find HyperLoRA useful in your research, please kindly cite our paper: 166 | ```bibtex 167 | @article{li2025hyperlora, 168 | title={HyperLoRA: Parameter-Efficient Adaptive Generation for Portrait Synthesis}, 169 | author={Mengtian Li and Jinshu Chen and Wanquan Feng and Bingchuan Li and Fei Dai and Songtao Zhao and Qian He}, 170 | journal={arXiv preprint arXiv:2503.16944}, 171 | year={2025} 172 | } 173 | ``` 174 | -------------------------------------------------------------------------------- /assets/HyperLoRA-T2I.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "b3c6f1fb-6d5e-494d-a6eb-eff4a1020dac", 3 | "revision": 0, 4 | "last_node_id": 17, 5 | "last_link_id": 24, 6 | "nodes": [ 7 | { 8 | "id": 2, 9 | "type": "HyperLoRAConfig", 10 | "pos": [ 11 | 594.7638549804688, 12 | -128.98974609375 13 | ], 14 | "size": [ 15 | 370.171875, 16 | 370 17 | ], 18 | "flags": {}, 19 | "order": 0, 20 | "mode": 0, 21 | "inputs": [], 22 | "outputs": [ 23 | { 24 | "name": "HYPER_LORA_CONFIG", 25 | "type": "HYPER_LORA_CONFIG", 26 | "links": [ 27 | 1 28 | ] 29 | } 30 | ], 31 | "properties": { 32 | "Node name for S&R": "HyperLoRAConfig" 33 | }, 34 | "widgets_values": [ 35 | "clip_vit_large_14_processor", 36 | "clip_vit_large_14", 37 | 1024, 38 | 64, 39 | 12, 40 | 4, 41 | 4, 42 | "clip + arcface", 43 | "antelopev2", 44 | 512, 45 | 16, 46 | 128, 47 | 8, 48 | false 49 | ] 50 | }, 51 | { 52 | "id": 7, 53 | "type": "HyperLoRAIDCond", 54 | "pos": [ 55 | 1012.1962280273438, 56 | 479.2580871582031 57 | ], 58 | "size": [ 59 | 249.3211669921875, 60 | 122.28309631347656 61 | ], 62 | "flags": {}, 63 | "order": 10, 64 | "mode": 0, 65 | "inputs": [ 66 | { 67 | "name": "hyper_lora", 68 | "type": "HYPER_LORA", 69 | "link": 7 70 | }, 71 | { 72 | "name": "images", 73 | "type": "IMAGE", 74 | "link": 6 75 | }, 76 | { 77 | "name": "face_attr", 78 | "type": "FACE_ATTR", 79 | "link": 5 80 | } 81 | ], 82 | "outputs": [ 83 | { 84 | "name": "ID_COND", 85 | "type": "ID_COND", 86 | "links": [ 87 | 8 88 | ] 89 | }, 90 | { 91 | "name": "IMAGE", 92 | "type": "IMAGE", 93 | "links": null 94 | } 95 | ], 96 | "properties": { 97 | "Node name for S&R": "HyperLoRAIDCond" 98 | }, 99 | "widgets_values": [ 100 | false, 101 | true 102 | ] 103 | }, 104 | { 105 | "id": 3, 106 | "type": "HyperLoRALoader", 107 | "pos": [ 108 | 602.7095947265625, 109 | 300.7662048339844 110 | ], 111 | "size": [ 112 | 358.7608947753906, 113 | 84.72722625732422 114 | ], 115 | "flags": {}, 116 | "order": 4, 117 | "mode": 0, 118 | "inputs": [ 119 | { 120 | "name": "config", 121 | "type": "HYPER_LORA_CONFIG", 122 | "link": 1 123 | } 124 | ], 125 | "outputs": [ 126 | { 127 | "name": "HYPER_LORA", 128 | "type": "HYPER_LORA", 129 | "links": [ 130 | 2, 131 | 7, 132 | 9 133 | ] 134 | } 135 | ], 136 | "properties": { 137 | "Node name for S&R": "HyperLoRALoader" 138 | }, 139 | "widgets_values": [ 140 | "sdxl_hyper_id_lora_v1_fidelity", 141 | "fp16" 142 | ] 143 | }, 144 | { 145 | "id": 4, 146 | "type": "HyperLoRAFaceAttr", 147 | "pos": [ 148 | 780.483642578125, 149 | 517.940673828125 150 | ], 151 | "size": [ 152 | 202.2093048095703, 153 | 46 154 | ], 155 | "flags": {}, 156 | "order": 9, 157 | "mode": 0, 158 | "inputs": [ 159 | { 160 | "name": "hyper_lora", 161 | "type": "HYPER_LORA", 162 | "link": 2 163 | }, 164 | { 165 | "name": "images", 166 | "type": "IMAGE", 167 | "link": 3 168 | } 169 | ], 170 | "outputs": [ 171 | { 172 | "name": "FACE_ATTR", 173 | "type": "FACE_ATTR", 174 | "links": [ 175 | 5 176 | ] 177 | } 178 | ], 179 | "properties": { 180 | "Node name for S&R": "HyperLoRAFaceAttr" 181 | }, 182 | "widgets_values": [] 183 | }, 184 | { 185 | "id": 8, 186 | "type": "HyperLoRAGenerateIDLoRA", 187 | "pos": [ 188 | 1289.8516845703125, 189 | 460.67413330078125 190 | ], 191 | "size": [ 192 | 249.1568145751953, 193 | 46 194 | ], 195 | "flags": {}, 196 | "order": 11, 197 | "mode": 0, 198 | "inputs": [ 199 | { 200 | "name": "hyper_lora", 201 | "type": "HYPER_LORA", 202 | "link": 9 203 | }, 204 | { 205 | "name": "id_cond", 206 | "type": "ID_COND", 207 | "link": 8 208 | } 209 | ], 210 | "outputs": [ 211 | { 212 | "name": "LORA", 213 | "type": "LORA", 214 | "links": [ 215 | 10 216 | ] 217 | } 218 | ], 219 | "properties": { 220 | "Node name for S&R": "HyperLoRAGenerateIDLoRA" 221 | }, 222 | "widgets_values": [] 223 | }, 224 | { 225 | "id": 5, 226 | "type": "ImpactMakeImageBatch", 227 | "pos": [ 228 | 497.7995300292969, 229 | 467.8606262207031 230 | ], 231 | "size": [ 232 | 176.5312042236328, 233 | 46 234 | ], 235 | "flags": {}, 236 | "order": 6, 237 | "mode": 0, 238 | "inputs": [ 239 | { 240 | "name": "image1", 241 | "type": "IMAGE", 242 | "link": 4 243 | }, 244 | { 245 | "name": "image2", 246 | "type": "IMAGE", 247 | "link": null 248 | } 249 | ], 250 | "outputs": [ 251 | { 252 | "name": "IMAGE", 253 | "type": "IMAGE", 254 | "links": [ 255 | 3, 256 | 6 257 | ] 258 | } 259 | ], 260 | "properties": { 261 | "Node name for S&R": "ImpactMakeImageBatch" 262 | }, 263 | "widgets_values": [] 264 | }, 265 | { 266 | "id": 14, 267 | "type": "EmptyLatentImage", 268 | "pos": [ 269 | 1387.7691650390625, 270 | 1137.106201171875 271 | ], 272 | "size": [ 273 | 210, 274 | 106 275 | ], 276 | "flags": {}, 277 | "order": 1, 278 | "mode": 0, 279 | "inputs": [], 280 | "outputs": [ 281 | { 282 | "name": "LATENT", 283 | "type": "LATENT", 284 | "links": [ 285 | 18 286 | ] 287 | } 288 | ], 289 | "properties": { 290 | "Node name for S&R": "EmptyLatentImage" 291 | }, 292 | "widgets_values": [ 293 | 1024, 294 | 1024, 295 | 1 296 | ] 297 | }, 298 | { 299 | "id": 15, 300 | "type": "CLIPSetLastLayer", 301 | "pos": [ 302 | 546.428466796875, 303 | 984.0955200195312 304 | ], 305 | "size": [ 306 | 243.56906127929688, 307 | 61.31538772583008 308 | ], 309 | "flags": {}, 310 | "order": 5, 311 | "mode": 0, 312 | "inputs": [ 313 | { 314 | "name": "clip", 315 | "type": "CLIP", 316 | "link": 21 317 | } 318 | ], 319 | "outputs": [ 320 | { 321 | "name": "CLIP", 322 | "type": "CLIP", 323 | "links": [ 324 | 19, 325 | 20 326 | ] 327 | } 328 | ], 329 | "properties": { 330 | "Node name for S&R": "CLIPSetLastLayer" 331 | }, 332 | "widgets_values": [ 333 | -2 334 | ] 335 | }, 336 | { 337 | "id": 13, 338 | "type": "BNK_CLIPTextEncodeAdvanced", 339 | "pos": [ 340 | 902.450439453125, 341 | 1075.2142333984375 342 | ], 343 | "size": [ 344 | 430.8000183105469, 345 | 200 346 | ], 347 | "flags": {}, 348 | "order": 8, 349 | "mode": 0, 350 | "inputs": [ 351 | { 352 | "name": "clip", 353 | "type": "CLIP", 354 | "link": 20 355 | } 356 | ], 357 | "outputs": [ 358 | { 359 | "name": "CONDITIONING", 360 | "type": "CONDITIONING", 361 | "links": [ 362 | 17 363 | ] 364 | } 365 | ], 366 | "properties": { 367 | "Node name for S&R": "BNK_CLIPTextEncodeAdvanced" 368 | }, 369 | "widgets_values": [ 370 | "big breast, nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, bad feet", 371 | "length+mean", 372 | "A1111" 373 | ] 374 | }, 375 | { 376 | "id": 1, 377 | "type": "CheckpointLoaderSimple", 378 | "pos": [ 379 | 453.893310546875, 380 | 679.7804565429688 381 | ], 382 | "size": [ 383 | 366.26171875, 384 | 98 385 | ], 386 | "flags": {}, 387 | "order": 2, 388 | "mode": 0, 389 | "inputs": [], 390 | "outputs": [ 391 | { 392 | "name": "MODEL", 393 | "type": "MODEL", 394 | "links": [ 395 | 11 396 | ] 397 | }, 398 | { 399 | "name": "CLIP", 400 | "type": "CLIP", 401 | "links": [ 402 | 21 403 | ] 404 | }, 405 | { 406 | "name": "VAE", 407 | "type": "VAE", 408 | "links": [ 409 | 23 410 | ] 411 | } 412 | ], 413 | "properties": { 414 | "Node name for S&R": "CheckpointLoaderSimple" 415 | }, 416 | "widgets_values": [ 417 | "RealVisXL_v4_BakedVAE.safetensors" 418 | ] 419 | }, 420 | { 421 | "id": 16, 422 | "type": "VAEDecode", 423 | "pos": [ 424 | 2076.439697265625, 425 | 815.1502075195312 426 | ], 427 | "size": [ 428 | 162.50253295898438, 429 | 47.082061767578125 430 | ], 431 | "flags": {}, 432 | "order": 14, 433 | "mode": 0, 434 | "inputs": [ 435 | { 436 | "name": "samples", 437 | "type": "LATENT", 438 | "link": 22 439 | }, 440 | { 441 | "name": "vae", 442 | "type": "VAE", 443 | "link": 23 444 | } 445 | ], 446 | "outputs": [ 447 | { 448 | "name": "IMAGE", 449 | "type": "IMAGE", 450 | "links": [ 451 | 24 452 | ] 453 | } 454 | ], 455 | "properties": { 456 | "Node name for S&R": "VAEDecode" 457 | }, 458 | "widgets_values": [] 459 | }, 460 | { 461 | "id": 17, 462 | "type": "PreviewImage", 463 | "pos": [ 464 | 2314.008056640625, 465 | 414.486328125 466 | ], 467 | "size": [ 468 | 597.0068359375, 469 | 650.1481323242188 470 | ], 471 | "flags": {}, 472 | "order": 15, 473 | "mode": 0, 474 | "inputs": [ 475 | { 476 | "name": "images", 477 | "type": "IMAGE", 478 | "link": 24 479 | } 480 | ], 481 | "outputs": [], 482 | "properties": { 483 | "Node name for S&R": "PreviewImage" 484 | }, 485 | "widgets_values": [] 486 | }, 487 | { 488 | "id": 6, 489 | "type": "LoadImage", 490 | "pos": [ 491 | 103.46822357177734, 492 | 353.53076171875 493 | ], 494 | "size": [ 495 | 315, 496 | 314 497 | ], 498 | "flags": {}, 499 | "order": 3, 500 | "mode": 0, 501 | "inputs": [], 502 | "outputs": [ 503 | { 504 | "name": "IMAGE", 505 | "type": "IMAGE", 506 | "links": [ 507 | 4 508 | ] 509 | }, 510 | { 511 | "name": "MASK", 512 | "type": "MASK", 513 | "links": null 514 | } 515 | ], 516 | "properties": { 517 | "Node name for S&R": "LoadImage" 518 | }, 519 | "widgets_values": [ 520 | "id-01.png", 521 | "image" 522 | ] 523 | }, 524 | { 525 | "id": 12, 526 | "type": "BNK_CLIPTextEncodeAdvanced", 527 | "pos": [ 528 | 904.4961547851562, 529 | 813.8724365234375 530 | ], 531 | "size": [ 532 | 430.8000183105469, 533 | 200 534 | ], 535 | "flags": {}, 536 | "order": 7, 537 | "mode": 0, 538 | "inputs": [ 539 | { 540 | "name": "clip", 541 | "type": "CLIP", 542 | "link": 19 543 | } 544 | ], 545 | "outputs": [ 546 | { 547 | "name": "CONDITIONING", 548 | "type": "CONDITIONING", 549 | "links": [ 550 | 16 551 | ] 552 | } 553 | ], 554 | "properties": { 555 | "Node name for S&R": "BNK_CLIPTextEncodeAdvanced" 556 | }, 557 | "widgets_values": [ 558 | "fcsks fxhks fhyks, Real photography, a girl, 4K, RAW photo, Korean portrait photography, korean style, close-up, 1 beautiful girl, exquisite makeup, delicate skin, long hair, beige off-shoulder sweater, depressed mood, ambient light, film lighting, polaroid effect, dark tone, snow scene, snowflakes Falling, outdoor shooting, background blur, Sunlight, (extreme light:1.2), Korean drama heroine's atmosphere, real photos, best picture quality, high details, (Nikon AF-S 105mm f/1.4E ED)", 559 | "length+mean", 560 | "A1111" 561 | ] 562 | }, 563 | { 564 | "id": 9, 565 | "type": "HyperLoRAApplyLoRA", 566 | "pos": [ 567 | 1298.61474609375, 568 | 677.2681884765625 569 | ], 570 | "size": [ 571 | 242.75352478027344, 572 | 78 573 | ], 574 | "flags": {}, 575 | "order": 12, 576 | "mode": 0, 577 | "inputs": [ 578 | { 579 | "name": "model", 580 | "type": "MODEL", 581 | "link": 11 582 | }, 583 | { 584 | "name": "lora", 585 | "type": "LORA", 586 | "link": 10 587 | } 588 | ], 589 | "outputs": [ 590 | { 591 | "name": "MODEL", 592 | "type": "MODEL", 593 | "links": [ 594 | 13 595 | ] 596 | } 597 | ], 598 | "properties": { 599 | "Node name for S&R": "HyperLoRAApplyLoRA" 600 | }, 601 | "widgets_values": [ 602 | 0.9 603 | ] 604 | }, 605 | { 606 | "id": 11, 607 | "type": "KSampler", 608 | "pos": [ 609 | 1721.9530029296875, 610 | 714.7071533203125 611 | ], 612 | "size": [ 613 | 315, 614 | 262 615 | ], 616 | "flags": {}, 617 | "order": 13, 618 | "mode": 0, 619 | "inputs": [ 620 | { 621 | "name": "model", 622 | "type": "MODEL", 623 | "link": 13 624 | }, 625 | { 626 | "name": "positive", 627 | "type": "CONDITIONING", 628 | "link": 16 629 | }, 630 | { 631 | "name": "negative", 632 | "type": "CONDITIONING", 633 | "link": 17 634 | }, 635 | { 636 | "name": "latent_image", 637 | "type": "LATENT", 638 | "link": 18 639 | } 640 | ], 641 | "outputs": [ 642 | { 643 | "name": "LATENT", 644 | "type": "LATENT", 645 | "links": [ 646 | 22 647 | ] 648 | } 649 | ], 650 | "properties": { 651 | "Node name for S&R": "KSampler" 652 | }, 653 | "widgets_values": [ 654 | 693709576827048, 655 | "fixed", 656 | 20, 657 | 5, 658 | "dpmpp_2m", 659 | "karras", 660 | 1 661 | ] 662 | } 663 | ], 664 | "links": [ 665 | [ 666 | 1, 667 | 2, 668 | 0, 669 | 3, 670 | 0, 671 | "HYPER_LORA_CONFIG" 672 | ], 673 | [ 674 | 2, 675 | 3, 676 | 0, 677 | 4, 678 | 0, 679 | "HYPER_LORA" 680 | ], 681 | [ 682 | 3, 683 | 5, 684 | 0, 685 | 4, 686 | 1, 687 | "IMAGE" 688 | ], 689 | [ 690 | 4, 691 | 6, 692 | 0, 693 | 5, 694 | 0, 695 | "IMAGE" 696 | ], 697 | [ 698 | 5, 699 | 4, 700 | 0, 701 | 7, 702 | 2, 703 | "FACE_ATTR" 704 | ], 705 | [ 706 | 6, 707 | 5, 708 | 0, 709 | 7, 710 | 1, 711 | "IMAGE" 712 | ], 713 | [ 714 | 7, 715 | 3, 716 | 0, 717 | 7, 718 | 0, 719 | "HYPER_LORA" 720 | ], 721 | [ 722 | 8, 723 | 7, 724 | 0, 725 | 8, 726 | 1, 727 | "ID_COND" 728 | ], 729 | [ 730 | 9, 731 | 3, 732 | 0, 733 | 8, 734 | 0, 735 | "HYPER_LORA" 736 | ], 737 | [ 738 | 10, 739 | 8, 740 | 0, 741 | 9, 742 | 1, 743 | "LORA" 744 | ], 745 | [ 746 | 11, 747 | 1, 748 | 0, 749 | 9, 750 | 0, 751 | "MODEL" 752 | ], 753 | [ 754 | 13, 755 | 9, 756 | 0, 757 | 11, 758 | 0, 759 | "MODEL" 760 | ], 761 | [ 762 | 16, 763 | 12, 764 | 0, 765 | 11, 766 | 1, 767 | "CONDITIONING" 768 | ], 769 | [ 770 | 17, 771 | 13, 772 | 0, 773 | 11, 774 | 2, 775 | "CONDITIONING" 776 | ], 777 | [ 778 | 18, 779 | 14, 780 | 0, 781 | 11, 782 | 3, 783 | "LATENT" 784 | ], 785 | [ 786 | 19, 787 | 15, 788 | 0, 789 | 12, 790 | 0, 791 | "CLIP" 792 | ], 793 | [ 794 | 20, 795 | 15, 796 | 0, 797 | 13, 798 | 0, 799 | "CLIP" 800 | ], 801 | [ 802 | 21, 803 | 1, 804 | 1, 805 | 15, 806 | 0, 807 | "CLIP" 808 | ], 809 | [ 810 | 22, 811 | 11, 812 | 0, 813 | 16, 814 | 0, 815 | "LATENT" 816 | ], 817 | [ 818 | 23, 819 | 1, 820 | 2, 821 | 16, 822 | 1, 823 | "VAE" 824 | ], 825 | [ 826 | 24, 827 | 16, 828 | 0, 829 | 17, 830 | 0, 831 | "IMAGE" 832 | ] 833 | ], 834 | "groups": [], 835 | "config": {}, 836 | "extra": { 837 | "ds": { 838 | "scale": 0.28966437973668785, 839 | "offset": [ 840 | 1601.650058855172, 841 | 1022.8701287038153 842 | ] 843 | }, 844 | "frontendVersion": "1.16.9" 845 | }, 846 | "version": 0.4 847 | } -------------------------------------------------------------------------------- /assets/HyperLoRA-T2I-ControlNet.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "b3c6f1fb-6d5e-494d-a6eb-eff4a1020dac", 3 | "revision": 0, 4 | "last_node_id": 20, 5 | "last_link_id": 30, 6 | "nodes": [ 7 | { 8 | "id": 2, 9 | "type": "HyperLoRAConfig", 10 | "pos": [ 11 | 594.7638549804688, 12 | -128.98974609375 13 | ], 14 | "size": [ 15 | 370.171875, 16 | 370 17 | ], 18 | "flags": {}, 19 | "order": 0, 20 | "mode": 0, 21 | "inputs": [], 22 | "outputs": [ 23 | { 24 | "name": "HYPER_LORA_CONFIG", 25 | "type": "HYPER_LORA_CONFIG", 26 | "links": [ 27 | 1 28 | ] 29 | } 30 | ], 31 | "properties": { 32 | "Node name for S&R": "HyperLoRAConfig" 33 | }, 34 | "widgets_values": [ 35 | "clip_vit_large_14_processor", 36 | "clip_vit_large_14", 37 | 1024, 38 | 64, 39 | 12, 40 | 4, 41 | 4, 42 | "clip + arcface", 43 | "antelopev2", 44 | 512, 45 | 16, 46 | 128, 47 | 8, 48 | false 49 | ] 50 | }, 51 | { 52 | "id": 7, 53 | "type": "HyperLoRAIDCond", 54 | "pos": [ 55 | 1012.1962280273438, 56 | 479.2580871582031 57 | ], 58 | "size": [ 59 | 249.3211669921875, 60 | 122.28309631347656 61 | ], 62 | "flags": {}, 63 | "order": 13, 64 | "mode": 0, 65 | "inputs": [ 66 | { 67 | "name": "hyper_lora", 68 | "type": "HYPER_LORA", 69 | "link": 7 70 | }, 71 | { 72 | "name": "images", 73 | "type": "IMAGE", 74 | "link": 6 75 | }, 76 | { 77 | "name": "face_attr", 78 | "type": "FACE_ATTR", 79 | "link": 5 80 | } 81 | ], 82 | "outputs": [ 83 | { 84 | "name": "ID_COND", 85 | "type": "ID_COND", 86 | "links": [ 87 | 8 88 | ] 89 | }, 90 | { 91 | "name": "IMAGE", 92 | "type": "IMAGE", 93 | "links": null 94 | } 95 | ], 96 | "properties": { 97 | "Node name for S&R": "HyperLoRAIDCond" 98 | }, 99 | "widgets_values": [ 100 | false, 101 | true 102 | ] 103 | }, 104 | { 105 | "id": 4, 106 | "type": "HyperLoRAFaceAttr", 107 | "pos": [ 108 | 780.483642578125, 109 | 517.940673828125 110 | ], 111 | "size": [ 112 | 202.2093048095703, 113 | 46 114 | ], 115 | "flags": {}, 116 | "order": 11, 117 | "mode": 0, 118 | "inputs": [ 119 | { 120 | "name": "hyper_lora", 121 | "type": "HYPER_LORA", 122 | "link": 2 123 | }, 124 | { 125 | "name": "images", 126 | "type": "IMAGE", 127 | "link": 3 128 | } 129 | ], 130 | "outputs": [ 131 | { 132 | "name": "FACE_ATTR", 133 | "type": "FACE_ATTR", 134 | "links": [ 135 | 5 136 | ] 137 | } 138 | ], 139 | "properties": { 140 | "Node name for S&R": "HyperLoRAFaceAttr" 141 | }, 142 | "widgets_values": [] 143 | }, 144 | { 145 | "id": 8, 146 | "type": "HyperLoRAGenerateIDLoRA", 147 | "pos": [ 148 | 1289.8516845703125, 149 | 460.67413330078125 150 | ], 151 | "size": [ 152 | 249.1568145751953, 153 | 46 154 | ], 155 | "flags": {}, 156 | "order": 14, 157 | "mode": 0, 158 | "inputs": [ 159 | { 160 | "name": "hyper_lora", 161 | "type": "HYPER_LORA", 162 | "link": 9 163 | }, 164 | { 165 | "name": "id_cond", 166 | "type": "ID_COND", 167 | "link": 8 168 | } 169 | ], 170 | "outputs": [ 171 | { 172 | "name": "LORA", 173 | "type": "LORA", 174 | "links": [ 175 | 10 176 | ] 177 | } 178 | ], 179 | "properties": { 180 | "Node name for S&R": "HyperLoRAGenerateIDLoRA" 181 | }, 182 | "widgets_values": [] 183 | }, 184 | { 185 | "id": 5, 186 | "type": "ImpactMakeImageBatch", 187 | "pos": [ 188 | 497.7995300292969, 189 | 467.8606262207031 190 | ], 191 | "size": [ 192 | 176.5312042236328, 193 | 46 194 | ], 195 | "flags": {}, 196 | "order": 8, 197 | "mode": 0, 198 | "inputs": [ 199 | { 200 | "name": "image1", 201 | "type": "IMAGE", 202 | "link": 4 203 | }, 204 | { 205 | "name": "image2", 206 | "type": "IMAGE", 207 | "link": null 208 | } 209 | ], 210 | "outputs": [ 211 | { 212 | "name": "IMAGE", 213 | "type": "IMAGE", 214 | "links": [ 215 | 3, 216 | 6 217 | ] 218 | } 219 | ], 220 | "properties": { 221 | "Node name for S&R": "ImpactMakeImageBatch" 222 | }, 223 | "widgets_values": [] 224 | }, 225 | { 226 | "id": 15, 227 | "type": "CLIPSetLastLayer", 228 | "pos": [ 229 | 546.428466796875, 230 | 984.0955200195312 231 | ], 232 | "size": [ 233 | 243.56906127929688, 234 | 61.31538772583008 235 | ], 236 | "flags": {}, 237 | "order": 7, 238 | "mode": 0, 239 | "inputs": [ 240 | { 241 | "name": "clip", 242 | "type": "CLIP", 243 | "link": 21 244 | } 245 | ], 246 | "outputs": [ 247 | { 248 | "name": "CLIP", 249 | "type": "CLIP", 250 | "links": [ 251 | 19, 252 | 20 253 | ] 254 | } 255 | ], 256 | "properties": { 257 | "Node name for S&R": "CLIPSetLastLayer" 258 | }, 259 | "widgets_values": [ 260 | -2 261 | ] 262 | }, 263 | { 264 | "id": 1, 265 | "type": "CheckpointLoaderSimple", 266 | "pos": [ 267 | 453.893310546875, 268 | 679.7804565429688 269 | ], 270 | "size": [ 271 | 366.26171875, 272 | 98 273 | ], 274 | "flags": {}, 275 | "order": 1, 276 | "mode": 0, 277 | "inputs": [], 278 | "outputs": [ 279 | { 280 | "name": "MODEL", 281 | "type": "MODEL", 282 | "links": [ 283 | 11 284 | ] 285 | }, 286 | { 287 | "name": "CLIP", 288 | "type": "CLIP", 289 | "links": [ 290 | 21 291 | ] 292 | }, 293 | { 294 | "name": "VAE", 295 | "type": "VAE", 296 | "links": [ 297 | 23 298 | ] 299 | } 300 | ], 301 | "properties": { 302 | "Node name for S&R": "CheckpointLoaderSimple" 303 | }, 304 | "widgets_values": [ 305 | "RealVisXL_v4_BakedVAE.safetensors" 306 | ] 307 | }, 308 | { 309 | "id": 16, 310 | "type": "VAEDecode", 311 | "pos": [ 312 | 2076.439697265625, 313 | 815.1502075195312 314 | ], 315 | "size": [ 316 | 162.50253295898438, 317 | 47.082061767578125 318 | ], 319 | "flags": {}, 320 | "order": 17, 321 | "mode": 0, 322 | "inputs": [ 323 | { 324 | "name": "samples", 325 | "type": "LATENT", 326 | "link": 22 327 | }, 328 | { 329 | "name": "vae", 330 | "type": "VAE", 331 | "link": 23 332 | } 333 | ], 334 | "outputs": [ 335 | { 336 | "name": "IMAGE", 337 | "type": "IMAGE", 338 | "links": [ 339 | 24 340 | ] 341 | } 342 | ], 343 | "properties": { 344 | "Node name for S&R": "VAEDecode" 345 | }, 346 | "widgets_values": [] 347 | }, 348 | { 349 | "id": 17, 350 | "type": "PreviewImage", 351 | "pos": [ 352 | 2314.008056640625, 353 | 414.486328125 354 | ], 355 | "size": [ 356 | 597.0068359375, 357 | 650.1481323242188 358 | ], 359 | "flags": {}, 360 | "order": 18, 361 | "mode": 0, 362 | "inputs": [ 363 | { 364 | "name": "images", 365 | "type": "IMAGE", 366 | "link": 24 367 | } 368 | ], 369 | "outputs": [], 370 | "properties": { 371 | "Node name for S&R": "PreviewImage" 372 | }, 373 | "widgets_values": [] 374 | }, 375 | { 376 | "id": 13, 377 | "type": "BNK_CLIPTextEncodeAdvanced", 378 | "pos": [ 379 | 902.450439453125, 380 | 1075.2142333984375 381 | ], 382 | "size": [ 383 | 430.8000183105469, 384 | 200 385 | ], 386 | "flags": {}, 387 | "order": 10, 388 | "mode": 0, 389 | "inputs": [ 390 | { 391 | "name": "clip", 392 | "type": "CLIP", 393 | "link": 20 394 | } 395 | ], 396 | "outputs": [ 397 | { 398 | "name": "CONDITIONING", 399 | "type": "CONDITIONING", 400 | "links": [ 401 | 27 402 | ] 403 | } 404 | ], 405 | "properties": { 406 | "Node name for S&R": "BNK_CLIPTextEncodeAdvanced" 407 | }, 408 | "widgets_values": [ 409 | "big breast, nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, bad feet", 410 | "length+mean", 411 | "A1111" 412 | ] 413 | }, 414 | { 415 | "id": 19, 416 | "type": "ControlNetApplyAdvanced", 417 | "pos": [ 418 | 1369.6954345703125, 419 | 810.7850341796875 420 | ], 421 | "size": [ 422 | 315, 423 | 186 424 | ], 425 | "flags": {}, 426 | "order": 12, 427 | "mode": 0, 428 | "inputs": [ 429 | { 430 | "name": "positive", 431 | "type": "CONDITIONING", 432 | "link": 26 433 | }, 434 | { 435 | "name": "negative", 436 | "type": "CONDITIONING", 437 | "link": 27 438 | }, 439 | { 440 | "name": "control_net", 441 | "type": "CONTROL_NET", 442 | "link": 25 443 | }, 444 | { 445 | "name": "image", 446 | "type": "IMAGE", 447 | "link": 30 448 | }, 449 | { 450 | "name": "vae", 451 | "shape": 7, 452 | "type": "VAE", 453 | "link": null 454 | } 455 | ], 456 | "outputs": [ 457 | { 458 | "name": "positive", 459 | "type": "CONDITIONING", 460 | "links": [ 461 | 28 462 | ] 463 | }, 464 | { 465 | "name": "negative", 466 | "type": "CONDITIONING", 467 | "links": [ 468 | 29 469 | ] 470 | } 471 | ], 472 | "properties": { 473 | "Node name for S&R": "ControlNetApplyAdvanced" 474 | }, 475 | "widgets_values": [ 476 | 0.7000000000000002, 477 | 0, 478 | 0.7000000000000002 479 | ] 480 | }, 481 | { 482 | "id": 14, 483 | "type": "EmptyLatentImage", 484 | "pos": [ 485 | 1766.1483154296875, 486 | 1033.189697265625 487 | ], 488 | "size": [ 489 | 210, 490 | 106 491 | ], 492 | "flags": {}, 493 | "order": 2, 494 | "mode": 0, 495 | "inputs": [], 496 | "outputs": [ 497 | { 498 | "name": "LATENT", 499 | "type": "LATENT", 500 | "links": [ 501 | 18 502 | ] 503 | } 504 | ], 505 | "properties": { 506 | "Node name for S&R": "EmptyLatentImage" 507 | }, 508 | "widgets_values": [ 509 | 1024, 510 | 1024, 511 | 1 512 | ] 513 | }, 514 | { 515 | "id": 18, 516 | "type": "ControlNetLoader", 517 | "pos": [ 518 | 1363.513671875, 519 | 1050.376708984375 520 | ], 521 | "size": [ 522 | 338.265625, 523 | 58 524 | ], 525 | "flags": {}, 526 | "order": 3, 527 | "mode": 0, 528 | "inputs": [], 529 | "outputs": [ 530 | { 531 | "name": "CONTROL_NET", 532 | "type": "CONTROL_NET", 533 | "links": [ 534 | 25 535 | ] 536 | } 537 | ], 538 | "properties": { 539 | "Node name for S&R": "ControlNetLoader" 540 | }, 541 | "widgets_values": [ 542 | "sdxl_openpose.safetensors" 543 | ] 544 | }, 545 | { 546 | "id": 20, 547 | "type": "LoadImage", 548 | "pos": [ 549 | 1364.4053955078125, 550 | 1166.5550537109375 551 | ], 552 | "size": [ 553 | 315, 554 | 314 555 | ], 556 | "flags": {}, 557 | "order": 4, 558 | "mode": 0, 559 | "inputs": [], 560 | "outputs": [ 561 | { 562 | "name": "IMAGE", 563 | "type": "IMAGE", 564 | "links": [ 565 | 30 566 | ] 567 | }, 568 | { 569 | "name": "MASK", 570 | "type": "MASK", 571 | "links": null 572 | } 573 | ], 574 | "properties": { 575 | "Node name for S&R": "LoadImage" 576 | }, 577 | "widgets_values": [ 578 | "pose.jpg", 579 | "image" 580 | ] 581 | }, 582 | { 583 | "id": 6, 584 | "type": "LoadImage", 585 | "pos": [ 586 | 103.46822357177734, 587 | 353.53076171875 588 | ], 589 | "size": [ 590 | 315, 591 | 314 592 | ], 593 | "flags": {}, 594 | "order": 5, 595 | "mode": 0, 596 | "inputs": [], 597 | "outputs": [ 598 | { 599 | "name": "IMAGE", 600 | "type": "IMAGE", 601 | "links": [ 602 | 4 603 | ] 604 | }, 605 | { 606 | "name": "MASK", 607 | "type": "MASK", 608 | "links": null 609 | } 610 | ], 611 | "properties": { 612 | "Node name for S&R": "LoadImage" 613 | }, 614 | "widgets_values": [ 615 | "id-03.png", 616 | "image" 617 | ] 618 | }, 619 | { 620 | "id": 9, 621 | "type": "HyperLoRAApplyLoRA", 622 | "pos": [ 623 | 1298.61474609375, 624 | 677.2681884765625 625 | ], 626 | "size": [ 627 | 242.75352478027344, 628 | 78 629 | ], 630 | "flags": {}, 631 | "order": 15, 632 | "mode": 0, 633 | "inputs": [ 634 | { 635 | "name": "model", 636 | "type": "MODEL", 637 | "link": 11 638 | }, 639 | { 640 | "name": "lora", 641 | "type": "LORA", 642 | "link": 10 643 | } 644 | ], 645 | "outputs": [ 646 | { 647 | "name": "MODEL", 648 | "type": "MODEL", 649 | "links": [ 650 | 13 651 | ] 652 | } 653 | ], 654 | "properties": { 655 | "Node name for S&R": "HyperLoRAApplyLoRA" 656 | }, 657 | "widgets_values": [ 658 | 0.85 659 | ] 660 | }, 661 | { 662 | "id": 12, 663 | "type": "BNK_CLIPTextEncodeAdvanced", 664 | "pos": [ 665 | 904.4961547851562, 666 | 813.8724365234375 667 | ], 668 | "size": [ 669 | 430.8000183105469, 670 | 200 671 | ], 672 | "flags": {}, 673 | "order": 9, 674 | "mode": 0, 675 | "inputs": [ 676 | { 677 | "name": "clip", 678 | "type": "CLIP", 679 | "link": 19 680 | } 681 | ], 682 | "outputs": [ 683 | { 684 | "name": "CONDITIONING", 685 | "type": "CONDITIONING", 686 | "links": [ 687 | 26 688 | ] 689 | } 690 | ], 691 | "properties": { 692 | "Node name for S&R": "BNK_CLIPTextEncodeAdvanced" 693 | }, 694 | "widgets_values": [ 695 | "fcsks fxhks fhyks, a man, white shirt, gray background", 696 | "length+mean", 697 | "A1111" 698 | ] 699 | }, 700 | { 701 | "id": 11, 702 | "type": "KSampler", 703 | "pos": [ 704 | 1721.9530029296875, 705 | 714.7071533203125 706 | ], 707 | "size": [ 708 | 315, 709 | 262 710 | ], 711 | "flags": {}, 712 | "order": 16, 713 | "mode": 0, 714 | "inputs": [ 715 | { 716 | "name": "model", 717 | "type": "MODEL", 718 | "link": 13 719 | }, 720 | { 721 | "name": "positive", 722 | "type": "CONDITIONING", 723 | "link": 28 724 | }, 725 | { 726 | "name": "negative", 727 | "type": "CONDITIONING", 728 | "link": 29 729 | }, 730 | { 731 | "name": "latent_image", 732 | "type": "LATENT", 733 | "link": 18 734 | } 735 | ], 736 | "outputs": [ 737 | { 738 | "name": "LATENT", 739 | "type": "LATENT", 740 | "links": [ 741 | 22 742 | ] 743 | } 744 | ], 745 | "properties": { 746 | "Node name for S&R": "KSampler" 747 | }, 748 | "widgets_values": [ 749 | 20801309000725, 750 | "fixed", 751 | 20, 752 | 5, 753 | "dpmpp_2m", 754 | "karras", 755 | 1 756 | ] 757 | }, 758 | { 759 | "id": 3, 760 | "type": "HyperLoRALoader", 761 | "pos": [ 762 | 602.7095947265625, 763 | 300.7662048339844 764 | ], 765 | "size": [ 766 | 358.7608947753906, 767 | 84.72722625732422 768 | ], 769 | "flags": {}, 770 | "order": 6, 771 | "mode": 0, 772 | "inputs": [ 773 | { 774 | "name": "config", 775 | "type": "HYPER_LORA_CONFIG", 776 | "link": 1 777 | } 778 | ], 779 | "outputs": [ 780 | { 781 | "name": "HYPER_LORA", 782 | "type": "HYPER_LORA", 783 | "links": [ 784 | 2, 785 | 7, 786 | 9 787 | ] 788 | } 789 | ], 790 | "properties": { 791 | "Node name for S&R": "HyperLoRALoader" 792 | }, 793 | "widgets_values": [ 794 | "sdxl_hyper_id_lora_v1_fidelity", 795 | "fp16" 796 | ] 797 | } 798 | ], 799 | "links": [ 800 | [ 801 | 1, 802 | 2, 803 | 0, 804 | 3, 805 | 0, 806 | "HYPER_LORA_CONFIG" 807 | ], 808 | [ 809 | 2, 810 | 3, 811 | 0, 812 | 4, 813 | 0, 814 | "HYPER_LORA" 815 | ], 816 | [ 817 | 3, 818 | 5, 819 | 0, 820 | 4, 821 | 1, 822 | "IMAGE" 823 | ], 824 | [ 825 | 4, 826 | 6, 827 | 0, 828 | 5, 829 | 0, 830 | "IMAGE" 831 | ], 832 | [ 833 | 5, 834 | 4, 835 | 0, 836 | 7, 837 | 2, 838 | "FACE_ATTR" 839 | ], 840 | [ 841 | 6, 842 | 5, 843 | 0, 844 | 7, 845 | 1, 846 | "IMAGE" 847 | ], 848 | [ 849 | 7, 850 | 3, 851 | 0, 852 | 7, 853 | 0, 854 | "HYPER_LORA" 855 | ], 856 | [ 857 | 8, 858 | 7, 859 | 0, 860 | 8, 861 | 1, 862 | "ID_COND" 863 | ], 864 | [ 865 | 9, 866 | 3, 867 | 0, 868 | 8, 869 | 0, 870 | "HYPER_LORA" 871 | ], 872 | [ 873 | 10, 874 | 8, 875 | 0, 876 | 9, 877 | 1, 878 | "LORA" 879 | ], 880 | [ 881 | 11, 882 | 1, 883 | 0, 884 | 9, 885 | 0, 886 | "MODEL" 887 | ], 888 | [ 889 | 13, 890 | 9, 891 | 0, 892 | 11, 893 | 0, 894 | "MODEL" 895 | ], 896 | [ 897 | 18, 898 | 14, 899 | 0, 900 | 11, 901 | 3, 902 | "LATENT" 903 | ], 904 | [ 905 | 19, 906 | 15, 907 | 0, 908 | 12, 909 | 0, 910 | "CLIP" 911 | ], 912 | [ 913 | 20, 914 | 15, 915 | 0, 916 | 13, 917 | 0, 918 | "CLIP" 919 | ], 920 | [ 921 | 21, 922 | 1, 923 | 1, 924 | 15, 925 | 0, 926 | "CLIP" 927 | ], 928 | [ 929 | 22, 930 | 11, 931 | 0, 932 | 16, 933 | 0, 934 | "LATENT" 935 | ], 936 | [ 937 | 23, 938 | 1, 939 | 2, 940 | 16, 941 | 1, 942 | "VAE" 943 | ], 944 | [ 945 | 24, 946 | 16, 947 | 0, 948 | 17, 949 | 0, 950 | "IMAGE" 951 | ], 952 | [ 953 | 25, 954 | 18, 955 | 0, 956 | 19, 957 | 2, 958 | "CONTROL_NET" 959 | ], 960 | [ 961 | 26, 962 | 12, 963 | 0, 964 | 19, 965 | 0, 966 | "CONDITIONING" 967 | ], 968 | [ 969 | 27, 970 | 13, 971 | 0, 972 | 19, 973 | 1, 974 | "CONDITIONING" 975 | ], 976 | [ 977 | 28, 978 | 19, 979 | 0, 980 | 11, 981 | 1, 982 | "CONDITIONING" 983 | ], 984 | [ 985 | 29, 986 | 19, 987 | 1, 988 | 11, 989 | 2, 990 | "CONDITIONING" 991 | ], 992 | [ 993 | 30, 994 | 20, 995 | 0, 996 | 19, 997 | 3, 998 | "IMAGE" 999 | ] 1000 | ], 1001 | "groups": [], 1002 | "config": {}, 1003 | "extra": { 1004 | "ds": { 1005 | "scale": 0.3855432894295319, 1006 | "offset": [ 1007 | 1062.8313065080142, 1008 | 520.9521132525936 1009 | ] 1010 | }, 1011 | "frontendVersion": "1.16.9" 1012 | }, 1013 | "version": 0.4 1014 | } -------------------------------------------------------------------------------- /assets/HyperLoRA-T2I-FaceDetailer.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "b3c6f1fb-6d5e-494d-a6eb-eff4a1020dac", 3 | "revision": 0, 4 | "last_node_id": 19, 5 | "last_link_id": 32, 6 | "nodes": [ 7 | { 8 | "id": 2, 9 | "type": "HyperLoRAConfig", 10 | "pos": [ 11 | 594.7638549804688, 12 | -128.98974609375 13 | ], 14 | "size": [ 15 | 370.171875, 16 | 370 17 | ], 18 | "flags": {}, 19 | "order": 0, 20 | "mode": 0, 21 | "inputs": [], 22 | "outputs": [ 23 | { 24 | "name": "HYPER_LORA_CONFIG", 25 | "type": "HYPER_LORA_CONFIG", 26 | "links": [ 27 | 1 28 | ] 29 | } 30 | ], 31 | "properties": { 32 | "Node name for S&R": "HyperLoRAConfig" 33 | }, 34 | "widgets_values": [ 35 | "clip_vit_large_14_processor", 36 | "clip_vit_large_14", 37 | 1024, 38 | 64, 39 | 12, 40 | 4, 41 | 4, 42 | "clip + arcface", 43 | "antelopev2", 44 | 512, 45 | 16, 46 | 128, 47 | 8, 48 | false 49 | ] 50 | }, 51 | { 52 | "id": 7, 53 | "type": "HyperLoRAIDCond", 54 | "pos": [ 55 | 1012.1962280273438, 56 | 479.2580871582031 57 | ], 58 | "size": [ 59 | 249.3211669921875, 60 | 122.28309631347656 61 | ], 62 | "flags": {}, 63 | "order": 11, 64 | "mode": 0, 65 | "inputs": [ 66 | { 67 | "name": "hyper_lora", 68 | "type": "HYPER_LORA", 69 | "link": 7 70 | }, 71 | { 72 | "name": "images", 73 | "type": "IMAGE", 74 | "link": 6 75 | }, 76 | { 77 | "name": "face_attr", 78 | "type": "FACE_ATTR", 79 | "link": 5 80 | } 81 | ], 82 | "outputs": [ 83 | { 84 | "name": "ID_COND", 85 | "type": "ID_COND", 86 | "links": [ 87 | 8 88 | ] 89 | }, 90 | { 91 | "name": "IMAGE", 92 | "type": "IMAGE", 93 | "links": null 94 | } 95 | ], 96 | "properties": { 97 | "Node name for S&R": "HyperLoRAIDCond" 98 | }, 99 | "widgets_values": [ 100 | false, 101 | true 102 | ] 103 | }, 104 | { 105 | "id": 3, 106 | "type": "HyperLoRALoader", 107 | "pos": [ 108 | 602.7095947265625, 109 | 300.7662048339844 110 | ], 111 | "size": [ 112 | 358.7608947753906, 113 | 84.72722625732422 114 | ], 115 | "flags": {}, 116 | "order": 5, 117 | "mode": 0, 118 | "inputs": [ 119 | { 120 | "name": "config", 121 | "type": "HYPER_LORA_CONFIG", 122 | "link": 1 123 | } 124 | ], 125 | "outputs": [ 126 | { 127 | "name": "HYPER_LORA", 128 | "type": "HYPER_LORA", 129 | "links": [ 130 | 2, 131 | 7, 132 | 9 133 | ] 134 | } 135 | ], 136 | "properties": { 137 | "Node name for S&R": "HyperLoRALoader" 138 | }, 139 | "widgets_values": [ 140 | "sdxl_hyper_id_lora_v1_fidelity", 141 | "fp16" 142 | ] 143 | }, 144 | { 145 | "id": 4, 146 | "type": "HyperLoRAFaceAttr", 147 | "pos": [ 148 | 780.483642578125, 149 | 517.940673828125 150 | ], 151 | "size": [ 152 | 202.2093048095703, 153 | 46 154 | ], 155 | "flags": {}, 156 | "order": 10, 157 | "mode": 0, 158 | "inputs": [ 159 | { 160 | "name": "hyper_lora", 161 | "type": "HYPER_LORA", 162 | "link": 2 163 | }, 164 | { 165 | "name": "images", 166 | "type": "IMAGE", 167 | "link": 3 168 | } 169 | ], 170 | "outputs": [ 171 | { 172 | "name": "FACE_ATTR", 173 | "type": "FACE_ATTR", 174 | "links": [ 175 | 5 176 | ] 177 | } 178 | ], 179 | "properties": { 180 | "Node name for S&R": "HyperLoRAFaceAttr" 181 | }, 182 | "widgets_values": [] 183 | }, 184 | { 185 | "id": 8, 186 | "type": "HyperLoRAGenerateIDLoRA", 187 | "pos": [ 188 | 1289.8516845703125, 189 | 460.67413330078125 190 | ], 191 | "size": [ 192 | 249.1568145751953, 193 | 46 194 | ], 195 | "flags": {}, 196 | "order": 12, 197 | "mode": 0, 198 | "inputs": [ 199 | { 200 | "name": "hyper_lora", 201 | "type": "HYPER_LORA", 202 | "link": 9 203 | }, 204 | { 205 | "name": "id_cond", 206 | "type": "ID_COND", 207 | "link": 8 208 | } 209 | ], 210 | "outputs": [ 211 | { 212 | "name": "LORA", 213 | "type": "LORA", 214 | "links": [ 215 | 10 216 | ] 217 | } 218 | ], 219 | "properties": { 220 | "Node name for S&R": "HyperLoRAGenerateIDLoRA" 221 | }, 222 | "widgets_values": [] 223 | }, 224 | { 225 | "id": 5, 226 | "type": "ImpactMakeImageBatch", 227 | "pos": [ 228 | 497.7995300292969, 229 | 467.8606262207031 230 | ], 231 | "size": [ 232 | 176.5312042236328, 233 | 46 234 | ], 235 | "flags": {}, 236 | "order": 7, 237 | "mode": 0, 238 | "inputs": [ 239 | { 240 | "name": "image1", 241 | "type": "IMAGE", 242 | "link": 4 243 | }, 244 | { 245 | "name": "image2", 246 | "type": "IMAGE", 247 | "link": null 248 | } 249 | ], 250 | "outputs": [ 251 | { 252 | "name": "IMAGE", 253 | "type": "IMAGE", 254 | "links": [ 255 | 3, 256 | 6 257 | ] 258 | } 259 | ], 260 | "properties": { 261 | "Node name for S&R": "ImpactMakeImageBatch" 262 | }, 263 | "widgets_values": [] 264 | }, 265 | { 266 | "id": 14, 267 | "type": "EmptyLatentImage", 268 | "pos": [ 269 | 1387.7691650390625, 270 | 1137.106201171875 271 | ], 272 | "size": [ 273 | 210, 274 | 106 275 | ], 276 | "flags": {}, 277 | "order": 1, 278 | "mode": 0, 279 | "inputs": [], 280 | "outputs": [ 281 | { 282 | "name": "LATENT", 283 | "type": "LATENT", 284 | "links": [ 285 | 18 286 | ] 287 | } 288 | ], 289 | "properties": { 290 | "Node name for S&R": "EmptyLatentImage" 291 | }, 292 | "widgets_values": [ 293 | 1024, 294 | 1024, 295 | 1 296 | ] 297 | }, 298 | { 299 | "id": 16, 300 | "type": "VAEDecode", 301 | "pos": [ 302 | 2076.439697265625, 303 | 815.1502075195312 304 | ], 305 | "size": [ 306 | 162.50253295898438, 307 | 47.082061767578125 308 | ], 309 | "flags": {}, 310 | "order": 15, 311 | "mode": 0, 312 | "inputs": [ 313 | { 314 | "name": "samples", 315 | "type": "LATENT", 316 | "link": 22 317 | }, 318 | { 319 | "name": "vae", 320 | "type": "VAE", 321 | "link": 23 322 | } 323 | ], 324 | "outputs": [ 325 | { 326 | "name": "IMAGE", 327 | "type": "IMAGE", 328 | "links": [ 329 | 25 330 | ] 331 | } 332 | ], 333 | "properties": { 334 | "Node name for S&R": "VAEDecode" 335 | }, 336 | "widgets_values": [] 337 | }, 338 | { 339 | "id": 17, 340 | "type": "PreviewImage", 341 | "pos": [ 342 | 2817.593994140625, 343 | 467.689208984375 344 | ], 345 | "size": [ 346 | 597.0068359375, 347 | 650.1481323242188 348 | ], 349 | "flags": {}, 350 | "order": 17, 351 | "mode": 0, 352 | "inputs": [ 353 | { 354 | "name": "images", 355 | "type": "IMAGE", 356 | "link": 26 357 | } 358 | ], 359 | "outputs": [], 360 | "properties": { 361 | "Node name for S&R": "PreviewImage" 362 | }, 363 | "widgets_values": [] 364 | }, 365 | { 366 | "id": 15, 367 | "type": "CLIPSetLastLayer", 368 | "pos": [ 369 | 546.428466796875, 370 | 984.0955200195312 371 | ], 372 | "size": [ 373 | 243.56906127929688, 374 | 61.31538772583008 375 | ], 376 | "flags": {}, 377 | "order": 6, 378 | "mode": 0, 379 | "inputs": [ 380 | { 381 | "name": "clip", 382 | "type": "CLIP", 383 | "link": 21 384 | } 385 | ], 386 | "outputs": [ 387 | { 388 | "name": "CLIP", 389 | "type": "CLIP", 390 | "links": [ 391 | 19, 392 | 20, 393 | 29 394 | ] 395 | } 396 | ], 397 | "properties": { 398 | "Node name for S&R": "CLIPSetLastLayer" 399 | }, 400 | "widgets_values": [ 401 | -2 402 | ] 403 | }, 404 | { 405 | "id": 1, 406 | "type": "CheckpointLoaderSimple", 407 | "pos": [ 408 | 453.893310546875, 409 | 679.7804565429688 410 | ], 411 | "size": [ 412 | 366.26171875, 413 | 98 414 | ], 415 | "flags": {}, 416 | "order": 2, 417 | "mode": 0, 418 | "inputs": [], 419 | "outputs": [ 420 | { 421 | "name": "MODEL", 422 | "type": "MODEL", 423 | "links": [ 424 | 11 425 | ] 426 | }, 427 | { 428 | "name": "CLIP", 429 | "type": "CLIP", 430 | "links": [ 431 | 21 432 | ] 433 | }, 434 | { 435 | "name": "VAE", 436 | "type": "VAE", 437 | "links": [ 438 | 23, 439 | 30 440 | ] 441 | } 442 | ], 443 | "properties": { 444 | "Node name for S&R": "CheckpointLoaderSimple" 445 | }, 446 | "widgets_values": [ 447 | "RealVisXL_v4_BakedVAE.safetensors" 448 | ] 449 | }, 450 | { 451 | "id": 13, 452 | "type": "BNK_CLIPTextEncodeAdvanced", 453 | "pos": [ 454 | 902.450439453125, 455 | 1075.2142333984375 456 | ], 457 | "size": [ 458 | 430.8000183105469, 459 | 200 460 | ], 461 | "flags": {}, 462 | "order": 9, 463 | "mode": 0, 464 | "inputs": [ 465 | { 466 | "name": "clip", 467 | "type": "CLIP", 468 | "link": 20 469 | } 470 | ], 471 | "outputs": [ 472 | { 473 | "name": "CONDITIONING", 474 | "type": "CONDITIONING", 475 | "links": [ 476 | 17, 477 | 32 478 | ] 479 | } 480 | ], 481 | "properties": { 482 | "Node name for S&R": "BNK_CLIPTextEncodeAdvanced" 483 | }, 484 | "widgets_values": [ 485 | "big breast, nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, bad feet", 486 | "length+mean", 487 | "A1111" 488 | ] 489 | }, 490 | { 491 | "id": 18, 492 | "type": "FaceDetailer", 493 | "pos": [ 494 | 2325.718505859375, 495 | 270.2817687988281 496 | ], 497 | "size": [ 498 | 413.20001220703125, 499 | 960 500 | ], 501 | "flags": {}, 502 | "order": 16, 503 | "mode": 0, 504 | "inputs": [ 505 | { 506 | "name": "image", 507 | "type": "IMAGE", 508 | "link": 25 509 | }, 510 | { 511 | "name": "model", 512 | "type": "MODEL", 513 | "link": 28 514 | }, 515 | { 516 | "name": "clip", 517 | "type": "CLIP", 518 | "link": 29 519 | }, 520 | { 521 | "name": "vae", 522 | "type": "VAE", 523 | "link": 30 524 | }, 525 | { 526 | "name": "positive", 527 | "type": "CONDITIONING", 528 | "link": 31 529 | }, 530 | { 531 | "name": "negative", 532 | "type": "CONDITIONING", 533 | "link": 32 534 | }, 535 | { 536 | "name": "bbox_detector", 537 | "type": "BBOX_DETECTOR", 538 | "link": 27 539 | }, 540 | { 541 | "name": "sam_model_opt", 542 | "shape": 7, 543 | "type": "SAM_MODEL", 544 | "link": null 545 | }, 546 | { 547 | "name": "segm_detector_opt", 548 | "shape": 7, 549 | "type": "SEGM_DETECTOR", 550 | "link": null 551 | }, 552 | { 553 | "name": "detailer_hook", 554 | "shape": 7, 555 | "type": "DETAILER_HOOK", 556 | "link": null 557 | }, 558 | { 559 | "name": "scheduler_func_opt", 560 | "shape": 7, 561 | "type": "SCHEDULER_FUNC", 562 | "link": null 563 | } 564 | ], 565 | "outputs": [ 566 | { 567 | "name": "image", 568 | "type": "IMAGE", 569 | "links": [ 570 | 26 571 | ] 572 | }, 573 | { 574 | "name": "cropped_refined", 575 | "shape": 6, 576 | "type": "IMAGE", 577 | "links": null 578 | }, 579 | { 580 | "name": "cropped_enhanced_alpha", 581 | "shape": 6, 582 | "type": "IMAGE", 583 | "links": null 584 | }, 585 | { 586 | "name": "mask", 587 | "type": "MASK", 588 | "links": null 589 | }, 590 | { 591 | "name": "detailer_pipe", 592 | "type": "DETAILER_PIPE", 593 | "links": null 594 | }, 595 | { 596 | "name": "cnet_images", 597 | "shape": 6, 598 | "type": "IMAGE", 599 | "links": null 600 | } 601 | ], 602 | "properties": { 603 | "Node name for S&R": "FaceDetailer" 604 | }, 605 | "widgets_values": [ 606 | 896, 607 | true, 608 | 896, 609 | 97030315765072, 610 | "fixed", 611 | 10, 612 | 5, 613 | "dpmpp_2m", 614 | "karras", 615 | 0.5, 616 | 5, 617 | true, 618 | true, 619 | 0.5, 620 | 10, 621 | 2, 622 | "center-1", 623 | 0, 624 | 0.93, 625 | 0, 626 | 0.7, 627 | "False", 628 | 10, 629 | "", 630 | 1, 631 | false, 632 | 0, 633 | false, 634 | false 635 | ] 636 | }, 637 | { 638 | "id": 19, 639 | "type": "UltralyticsDetectorProvider", 640 | "pos": [ 641 | 2350.880615234375, 642 | 138.29702758789062 643 | ], 644 | "size": [ 645 | 340.20001220703125, 646 | 78 647 | ], 648 | "flags": {}, 649 | "order": 3, 650 | "mode": 0, 651 | "inputs": [], 652 | "outputs": [ 653 | { 654 | "name": "BBOX_DETECTOR", 655 | "type": "BBOX_DETECTOR", 656 | "links": [ 657 | 27 658 | ] 659 | }, 660 | { 661 | "name": "SEGM_DETECTOR", 662 | "type": "SEGM_DETECTOR", 663 | "links": null 664 | } 665 | ], 666 | "properties": { 667 | "Node name for S&R": "UltralyticsDetectorProvider" 668 | }, 669 | "widgets_values": [ 670 | "bbox/face_yolov8m.pt" 671 | ] 672 | }, 673 | { 674 | "id": 6, 675 | "type": "LoadImage", 676 | "pos": [ 677 | 103.46822357177734, 678 | 353.53076171875 679 | ], 680 | "size": [ 681 | 315, 682 | 314 683 | ], 684 | "flags": {}, 685 | "order": 4, 686 | "mode": 0, 687 | "inputs": [], 688 | "outputs": [ 689 | { 690 | "name": "IMAGE", 691 | "type": "IMAGE", 692 | "links": [ 693 | 4 694 | ] 695 | }, 696 | { 697 | "name": "MASK", 698 | "type": "MASK", 699 | "links": null 700 | } 701 | ], 702 | "properties": { 703 | "Node name for S&R": "LoadImage" 704 | }, 705 | "widgets_values": [ 706 | "id-02.png", 707 | "image" 708 | ] 709 | }, 710 | { 711 | "id": 9, 712 | "type": "HyperLoRAApplyLoRA", 713 | "pos": [ 714 | 1298.61474609375, 715 | 677.2681884765625 716 | ], 717 | "size": [ 718 | 242.75352478027344, 719 | 78 720 | ], 721 | "flags": {}, 722 | "order": 13, 723 | "mode": 0, 724 | "inputs": [ 725 | { 726 | "name": "model", 727 | "type": "MODEL", 728 | "link": 11 729 | }, 730 | { 731 | "name": "lora", 732 | "type": "LORA", 733 | "link": 10 734 | } 735 | ], 736 | "outputs": [ 737 | { 738 | "name": "MODEL", 739 | "type": "MODEL", 740 | "links": [ 741 | 13, 742 | 28 743 | ] 744 | } 745 | ], 746 | "properties": { 747 | "Node name for S&R": "HyperLoRAApplyLoRA" 748 | }, 749 | "widgets_values": [ 750 | 0.85 751 | ] 752 | }, 753 | { 754 | "id": 12, 755 | "type": "BNK_CLIPTextEncodeAdvanced", 756 | "pos": [ 757 | 904.4961547851562, 758 | 813.8724365234375 759 | ], 760 | "size": [ 761 | 430.8000183105469, 762 | 200 763 | ], 764 | "flags": {}, 765 | "order": 8, 766 | "mode": 0, 767 | "inputs": [ 768 | { 769 | "name": "clip", 770 | "type": "CLIP", 771 | "link": 19 772 | } 773 | ], 774 | "outputs": [ 775 | { 776 | "name": "CONDITIONING", 777 | "type": "CONDITIONING", 778 | "links": [ 779 | 16, 780 | 31 781 | ] 782 | } 783 | ], 784 | "properties": { 785 | "Node name for S&R": "BNK_CLIPTextEncodeAdvanced" 786 | }, 787 | "widgets_values": [ 788 | "fcsks fxhks fhyks, a young woman, wearing wedding dress, at church", 789 | "length+mean", 790 | "A1111" 791 | ] 792 | }, 793 | { 794 | "id": 11, 795 | "type": "KSampler", 796 | "pos": [ 797 | 1716.4571533203125, 798 | 698.2420043945312 799 | ], 800 | "size": [ 801 | 315, 802 | 262 803 | ], 804 | "flags": {}, 805 | "order": 14, 806 | "mode": 0, 807 | "inputs": [ 808 | { 809 | "name": "model", 810 | "type": "MODEL", 811 | "link": 13 812 | }, 813 | { 814 | "name": "positive", 815 | "type": "CONDITIONING", 816 | "link": 16 817 | }, 818 | { 819 | "name": "negative", 820 | "type": "CONDITIONING", 821 | "link": 17 822 | }, 823 | { 824 | "name": "latent_image", 825 | "type": "LATENT", 826 | "link": 18 827 | } 828 | ], 829 | "outputs": [ 830 | { 831 | "name": "LATENT", 832 | "type": "LATENT", 833 | "links": [ 834 | 22 835 | ] 836 | } 837 | ], 838 | "properties": { 839 | "Node name for S&R": "KSampler" 840 | }, 841 | "widgets_values": [ 842 | 56761277541164, 843 | "fixed", 844 | 20, 845 | 5, 846 | "dpmpp_2m", 847 | "karras", 848 | 1 849 | ] 850 | } 851 | ], 852 | "links": [ 853 | [ 854 | 1, 855 | 2, 856 | 0, 857 | 3, 858 | 0, 859 | "HYPER_LORA_CONFIG" 860 | ], 861 | [ 862 | 2, 863 | 3, 864 | 0, 865 | 4, 866 | 0, 867 | "HYPER_LORA" 868 | ], 869 | [ 870 | 3, 871 | 5, 872 | 0, 873 | 4, 874 | 1, 875 | "IMAGE" 876 | ], 877 | [ 878 | 4, 879 | 6, 880 | 0, 881 | 5, 882 | 0, 883 | "IMAGE" 884 | ], 885 | [ 886 | 5, 887 | 4, 888 | 0, 889 | 7, 890 | 2, 891 | "FACE_ATTR" 892 | ], 893 | [ 894 | 6, 895 | 5, 896 | 0, 897 | 7, 898 | 1, 899 | "IMAGE" 900 | ], 901 | [ 902 | 7, 903 | 3, 904 | 0, 905 | 7, 906 | 0, 907 | "HYPER_LORA" 908 | ], 909 | [ 910 | 8, 911 | 7, 912 | 0, 913 | 8, 914 | 1, 915 | "ID_COND" 916 | ], 917 | [ 918 | 9, 919 | 3, 920 | 0, 921 | 8, 922 | 0, 923 | "HYPER_LORA" 924 | ], 925 | [ 926 | 10, 927 | 8, 928 | 0, 929 | 9, 930 | 1, 931 | "LORA" 932 | ], 933 | [ 934 | 11, 935 | 1, 936 | 0, 937 | 9, 938 | 0, 939 | "MODEL" 940 | ], 941 | [ 942 | 13, 943 | 9, 944 | 0, 945 | 11, 946 | 0, 947 | "MODEL" 948 | ], 949 | [ 950 | 16, 951 | 12, 952 | 0, 953 | 11, 954 | 1, 955 | "CONDITIONING" 956 | ], 957 | [ 958 | 17, 959 | 13, 960 | 0, 961 | 11, 962 | 2, 963 | "CONDITIONING" 964 | ], 965 | [ 966 | 18, 967 | 14, 968 | 0, 969 | 11, 970 | 3, 971 | "LATENT" 972 | ], 973 | [ 974 | 19, 975 | 15, 976 | 0, 977 | 12, 978 | 0, 979 | "CLIP" 980 | ], 981 | [ 982 | 20, 983 | 15, 984 | 0, 985 | 13, 986 | 0, 987 | "CLIP" 988 | ], 989 | [ 990 | 21, 991 | 1, 992 | 1, 993 | 15, 994 | 0, 995 | "CLIP" 996 | ], 997 | [ 998 | 22, 999 | 11, 1000 | 0, 1001 | 16, 1002 | 0, 1003 | "LATENT" 1004 | ], 1005 | [ 1006 | 23, 1007 | 1, 1008 | 2, 1009 | 16, 1010 | 1, 1011 | "VAE" 1012 | ], 1013 | [ 1014 | 25, 1015 | 16, 1016 | 0, 1017 | 18, 1018 | 0, 1019 | "IMAGE" 1020 | ], 1021 | [ 1022 | 26, 1023 | 18, 1024 | 0, 1025 | 17, 1026 | 0, 1027 | "IMAGE" 1028 | ], 1029 | [ 1030 | 27, 1031 | 19, 1032 | 0, 1033 | 18, 1034 | 6, 1035 | "BBOX_DETECTOR" 1036 | ], 1037 | [ 1038 | 28, 1039 | 9, 1040 | 0, 1041 | 18, 1042 | 1, 1043 | "MODEL" 1044 | ], 1045 | [ 1046 | 29, 1047 | 15, 1048 | 0, 1049 | 18, 1050 | 2, 1051 | "CLIP" 1052 | ], 1053 | [ 1054 | 30, 1055 | 1, 1056 | 2, 1057 | 18, 1058 | 3, 1059 | "VAE" 1060 | ], 1061 | [ 1062 | 31, 1063 | 12, 1064 | 0, 1065 | 18, 1066 | 4, 1067 | "CONDITIONING" 1068 | ], 1069 | [ 1070 | 32, 1071 | 13, 1072 | 0, 1073 | 18, 1074 | 5, 1075 | "CONDITIONING" 1076 | ] 1077 | ], 1078 | "groups": [], 1079 | "config": {}, 1080 | "extra": { 1081 | "ds": { 1082 | "scale": 0.26333125430608, 1083 | "offset": [ 1084 | 1985.0242954772148, 1085 | 1143.084630914155 1086 | ] 1087 | }, 1088 | "frontendVersion": "1.16.9" 1089 | }, 1090 | "version": 0.4 1091 | } -------------------------------------------------------------------------------- /assets/HyperLoRA-T2I-InstantID.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "b3c6f1fb-6d5e-494d-a6eb-eff4a1020dac", 3 | "revision": 0, 4 | "last_node_id": 23, 5 | "last_link_id": 35, 6 | "nodes": [ 7 | { 8 | "id": 2, 9 | "type": "HyperLoRAConfig", 10 | "pos": [ 11 | 594.7638549804688, 12 | -128.98974609375 13 | ], 14 | "size": [ 15 | 370.171875, 16 | 370 17 | ], 18 | "flags": {}, 19 | "order": 0, 20 | "mode": 0, 21 | "inputs": [], 22 | "outputs": [ 23 | { 24 | "name": "HYPER_LORA_CONFIG", 25 | "type": "HYPER_LORA_CONFIG", 26 | "links": [ 27 | 1 28 | ] 29 | } 30 | ], 31 | "properties": { 32 | "Node name for S&R": "HyperLoRAConfig" 33 | }, 34 | "widgets_values": [ 35 | "clip_vit_large_14_processor", 36 | "clip_vit_large_14", 37 | 1024, 38 | 64, 39 | 12, 40 | 4, 41 | 4, 42 | "clip + arcface", 43 | "antelopev2", 44 | 512, 45 | 16, 46 | 128, 47 | 8, 48 | false 49 | ] 50 | }, 51 | { 52 | "id": 7, 53 | "type": "HyperLoRAIDCond", 54 | "pos": [ 55 | 1012.1962280273438, 56 | 479.2580871582031 57 | ], 58 | "size": [ 59 | 249.3211669921875, 60 | 122.28309631347656 61 | ], 62 | "flags": {}, 63 | "order": 15, 64 | "mode": 0, 65 | "inputs": [ 66 | { 67 | "name": "hyper_lora", 68 | "type": "HYPER_LORA", 69 | "link": 7 70 | }, 71 | { 72 | "name": "images", 73 | "type": "IMAGE", 74 | "link": 6 75 | }, 76 | { 77 | "name": "face_attr", 78 | "type": "FACE_ATTR", 79 | "link": 5 80 | } 81 | ], 82 | "outputs": [ 83 | { 84 | "name": "ID_COND", 85 | "type": "ID_COND", 86 | "links": [ 87 | 8 88 | ] 89 | }, 90 | { 91 | "name": "IMAGE", 92 | "type": "IMAGE", 93 | "links": null 94 | } 95 | ], 96 | "properties": { 97 | "Node name for S&R": "HyperLoRAIDCond" 98 | }, 99 | "widgets_values": [ 100 | false, 101 | true 102 | ] 103 | }, 104 | { 105 | "id": 3, 106 | "type": "HyperLoRALoader", 107 | "pos": [ 108 | 602.7095947265625, 109 | 300.7662048339844 110 | ], 111 | "size": [ 112 | 358.7608947753906, 113 | 84.72722625732422 114 | ], 115 | "flags": {}, 116 | "order": 8, 117 | "mode": 0, 118 | "inputs": [ 119 | { 120 | "name": "config", 121 | "type": "HYPER_LORA_CONFIG", 122 | "link": 1 123 | } 124 | ], 125 | "outputs": [ 126 | { 127 | "name": "HYPER_LORA", 128 | "type": "HYPER_LORA", 129 | "links": [ 130 | 2, 131 | 7, 132 | 9 133 | ] 134 | } 135 | ], 136 | "properties": { 137 | "Node name for S&R": "HyperLoRALoader" 138 | }, 139 | "widgets_values": [ 140 | "sdxl_hyper_id_lora_v1_fidelity", 141 | "fp16" 142 | ] 143 | }, 144 | { 145 | "id": 4, 146 | "type": "HyperLoRAFaceAttr", 147 | "pos": [ 148 | 780.483642578125, 149 | 517.940673828125 150 | ], 151 | "size": [ 152 | 202.2093048095703, 153 | 46 154 | ], 155 | "flags": {}, 156 | "order": 13, 157 | "mode": 0, 158 | "inputs": [ 159 | { 160 | "name": "hyper_lora", 161 | "type": "HYPER_LORA", 162 | "link": 2 163 | }, 164 | { 165 | "name": "images", 166 | "type": "IMAGE", 167 | "link": 3 168 | } 169 | ], 170 | "outputs": [ 171 | { 172 | "name": "FACE_ATTR", 173 | "type": "FACE_ATTR", 174 | "links": [ 175 | 5 176 | ] 177 | } 178 | ], 179 | "properties": { 180 | "Node name for S&R": "HyperLoRAFaceAttr" 181 | }, 182 | "widgets_values": [] 183 | }, 184 | { 185 | "id": 8, 186 | "type": "HyperLoRAGenerateIDLoRA", 187 | "pos": [ 188 | 1289.8516845703125, 189 | 460.67413330078125 190 | ], 191 | "size": [ 192 | 249.1568145751953, 193 | 46 194 | ], 195 | "flags": {}, 196 | "order": 16, 197 | "mode": 0, 198 | "inputs": [ 199 | { 200 | "name": "hyper_lora", 201 | "type": "HYPER_LORA", 202 | "link": 9 203 | }, 204 | { 205 | "name": "id_cond", 206 | "type": "ID_COND", 207 | "link": 8 208 | } 209 | ], 210 | "outputs": [ 211 | { 212 | "name": "LORA", 213 | "type": "LORA", 214 | "links": [ 215 | 10 216 | ] 217 | } 218 | ], 219 | "properties": { 220 | "Node name for S&R": "HyperLoRAGenerateIDLoRA" 221 | }, 222 | "widgets_values": [] 223 | }, 224 | { 225 | "id": 15, 226 | "type": "CLIPSetLastLayer", 227 | "pos": [ 228 | 546.428466796875, 229 | 984.0955200195312 230 | ], 231 | "size": [ 232 | 243.56906127929688, 233 | 61.31538772583008 234 | ], 235 | "flags": {}, 236 | "order": 9, 237 | "mode": 0, 238 | "inputs": [ 239 | { 240 | "name": "clip", 241 | "type": "CLIP", 242 | "link": 21 243 | } 244 | ], 245 | "outputs": [ 246 | { 247 | "name": "CLIP", 248 | "type": "CLIP", 249 | "links": [ 250 | 19, 251 | 20 252 | ] 253 | } 254 | ], 255 | "properties": { 256 | "Node name for S&R": "CLIPSetLastLayer" 257 | }, 258 | "widgets_values": [ 259 | -2 260 | ] 261 | }, 262 | { 263 | "id": 16, 264 | "type": "VAEDecode", 265 | "pos": [ 266 | 2076.439697265625, 267 | 815.1502075195312 268 | ], 269 | "size": [ 270 | 162.50253295898438, 271 | 47.082061767578125 272 | ], 273 | "flags": {}, 274 | "order": 19, 275 | "mode": 0, 276 | "inputs": [ 277 | { 278 | "name": "samples", 279 | "type": "LATENT", 280 | "link": 22 281 | }, 282 | { 283 | "name": "vae", 284 | "type": "VAE", 285 | "link": 23 286 | } 287 | ], 288 | "outputs": [ 289 | { 290 | "name": "IMAGE", 291 | "type": "IMAGE", 292 | "links": [ 293 | 24 294 | ] 295 | } 296 | ], 297 | "properties": { 298 | "Node name for S&R": "VAEDecode" 299 | }, 300 | "widgets_values": [] 301 | }, 302 | { 303 | "id": 17, 304 | "type": "PreviewImage", 305 | "pos": [ 306 | 2314.008056640625, 307 | 414.486328125 308 | ], 309 | "size": [ 310 | 597.0068359375, 311 | 650.1481323242188 312 | ], 313 | "flags": {}, 314 | "order": 20, 315 | "mode": 0, 316 | "inputs": [ 317 | { 318 | "name": "images", 319 | "type": "IMAGE", 320 | "link": 24 321 | } 322 | ], 323 | "outputs": [], 324 | "properties": { 325 | "Node name for S&R": "PreviewImage" 326 | }, 327 | "widgets_values": [] 328 | }, 329 | { 330 | "id": 19, 331 | "type": "InstantIDModelLoader", 332 | "pos": [ 333 | 485.0365295410156, 334 | 1305.0845947265625 335 | ], 336 | "size": [ 337 | 268.9437561035156, 338 | 58 339 | ], 340 | "flags": {}, 341 | "order": 1, 342 | "mode": 0, 343 | "inputs": [], 344 | "outputs": [ 345 | { 346 | "name": "INSTANTID", 347 | "type": "INSTANTID", 348 | "links": [ 349 | 25 350 | ] 351 | } 352 | ], 353 | "properties": { 354 | "Node name for S&R": "InstantIDModelLoader" 355 | }, 356 | "widgets_values": [ 357 | "ip-adapter.bin" 358 | ] 359 | }, 360 | { 361 | "id": 20, 362 | "type": "InstantIDFaceAnalysis", 363 | "pos": [ 364 | 453.8786315917969, 365 | 1432.2781982421875 366 | ], 367 | "size": [ 368 | 273.7707214355469, 369 | 58 370 | ], 371 | "flags": {}, 372 | "order": 2, 373 | "mode": 0, 374 | "inputs": [], 375 | "outputs": [ 376 | { 377 | "name": "FACEANALYSIS", 378 | "type": "FACEANALYSIS", 379 | "links": [ 380 | 26 381 | ] 382 | } 383 | ], 384 | "properties": { 385 | "Node name for S&R": "InstantIDFaceAnalysis" 386 | }, 387 | "widgets_values": [ 388 | "CPU" 389 | ] 390 | }, 391 | { 392 | "id": 21, 393 | "type": "ControlNetLoader", 394 | "pos": [ 395 | 242.60777282714844, 396 | 1548.8629150390625 397 | ], 398 | "size": [ 399 | 482.9313049316406, 400 | 58 401 | ], 402 | "flags": {}, 403 | "order": 3, 404 | "mode": 0, 405 | "inputs": [], 406 | "outputs": [ 407 | { 408 | "name": "CONTROL_NET", 409 | "type": "CONTROL_NET", 410 | "links": [ 411 | 27 412 | ] 413 | } 414 | ], 415 | "properties": { 416 | "Node name for S&R": "ControlNetLoader" 417 | }, 418 | "widgets_values": [ 419 | "instantid/diffusion_pytorch_model.safetensors" 420 | ] 421 | }, 422 | { 423 | "id": 5, 424 | "type": "ImpactMakeImageBatch", 425 | "pos": [ 426 | 497.7995300292969, 427 | 467.8606262207031 428 | ], 429 | "size": [ 430 | 176.5312042236328, 431 | 46 432 | ], 433 | "flags": {}, 434 | "order": 10, 435 | "mode": 0, 436 | "inputs": [ 437 | { 438 | "name": "image1", 439 | "type": "IMAGE", 440 | "link": 4 441 | }, 442 | { 443 | "name": "image2", 444 | "type": "IMAGE", 445 | "link": null 446 | } 447 | ], 448 | "outputs": [ 449 | { 450 | "name": "IMAGE", 451 | "type": "IMAGE", 452 | "links": [ 453 | 3, 454 | 6, 455 | 29 456 | ] 457 | } 458 | ], 459 | "properties": { 460 | "Node name for S&R": "ImpactMakeImageBatch" 461 | }, 462 | "widgets_values": [] 463 | }, 464 | { 465 | "id": 1, 466 | "type": "CheckpointLoaderSimple", 467 | "pos": [ 468 | 453.893310546875, 469 | 679.7804565429688 470 | ], 471 | "size": [ 472 | 366.26171875, 473 | 98 474 | ], 475 | "flags": {}, 476 | "order": 4, 477 | "mode": 0, 478 | "inputs": [], 479 | "outputs": [ 480 | { 481 | "name": "MODEL", 482 | "type": "MODEL", 483 | "links": [ 484 | 11, 485 | 30 486 | ] 487 | }, 488 | { 489 | "name": "CLIP", 490 | "type": "CLIP", 491 | "links": [ 492 | 21 493 | ] 494 | }, 495 | { 496 | "name": "VAE", 497 | "type": "VAE", 498 | "links": [ 499 | 23 500 | ] 501 | } 502 | ], 503 | "properties": { 504 | "Node name for S&R": "CheckpointLoaderSimple" 505 | }, 506 | "widgets_values": [ 507 | "RealVisXL_v4_BakedVAE.safetensors" 508 | ] 509 | }, 510 | { 511 | "id": 13, 512 | "type": "BNK_CLIPTextEncodeAdvanced", 513 | "pos": [ 514 | 902.450439453125, 515 | 1075.2142333984375 516 | ], 517 | "size": [ 518 | 430.8000183105469, 519 | 200 520 | ], 521 | "flags": {}, 522 | "order": 12, 523 | "mode": 0, 524 | "inputs": [ 525 | { 526 | "name": "clip", 527 | "type": "CLIP", 528 | "link": 20 529 | } 530 | ], 531 | "outputs": [ 532 | { 533 | "name": "CONDITIONING", 534 | "type": "CONDITIONING", 535 | "links": [ 536 | 34 537 | ] 538 | } 539 | ], 540 | "properties": { 541 | "Node name for S&R": "BNK_CLIPTextEncodeAdvanced" 542 | }, 543 | "widgets_values": [ 544 | "big breast, nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, bad feet", 545 | "length+mean", 546 | "A1111" 547 | ] 548 | }, 549 | { 550 | "id": 6, 551 | "type": "LoadImage", 552 | "pos": [ 553 | 103.46822357177734, 554 | 353.53076171875 555 | ], 556 | "size": [ 557 | 315, 558 | 314 559 | ], 560 | "flags": {}, 561 | "order": 5, 562 | "mode": 0, 563 | "inputs": [], 564 | "outputs": [ 565 | { 566 | "name": "IMAGE", 567 | "type": "IMAGE", 568 | "links": [ 569 | 4 570 | ] 571 | }, 572 | { 573 | "name": "MASK", 574 | "type": "MASK", 575 | "links": null 576 | } 577 | ], 578 | "properties": { 579 | "Node name for S&R": "LoadImage" 580 | }, 581 | "widgets_values": [ 582 | "id-04.png", 583 | "image" 584 | ] 585 | }, 586 | { 587 | "id": 23, 588 | "type": "LoadImage", 589 | "pos": [ 590 | 105.0623779296875, 591 | 1136.4041748046875 592 | ], 593 | "size": [ 594 | 315, 595 | 314 596 | ], 597 | "flags": {}, 598 | "order": 6, 599 | "mode": 0, 600 | "inputs": [], 601 | "outputs": [ 602 | { 603 | "name": "IMAGE", 604 | "type": "IMAGE", 605 | "links": [ 606 | 35 607 | ] 608 | }, 609 | { 610 | "name": "MASK", 611 | "type": "MASK", 612 | "links": null 613 | } 614 | ], 615 | "properties": { 616 | "Node name for S&R": "LoadImage" 617 | }, 618 | "widgets_values": [ 619 | "ref-kps.png", 620 | "image" 621 | ] 622 | }, 623 | { 624 | "id": 14, 625 | "type": "EmptyLatentImage", 626 | "pos": [ 627 | 1457.79443359375, 628 | 1079.045654296875 629 | ], 630 | "size": [ 631 | 210, 632 | 106 633 | ], 634 | "flags": {}, 635 | "order": 7, 636 | "mode": 0, 637 | "inputs": [], 638 | "outputs": [ 639 | { 640 | "name": "LATENT", 641 | "type": "LATENT", 642 | "links": [ 643 | 18 644 | ] 645 | } 646 | ], 647 | "properties": { 648 | "Node name for S&R": "EmptyLatentImage" 649 | }, 650 | "widgets_values": [ 651 | 1024, 652 | 1024, 653 | 1 654 | ] 655 | }, 656 | { 657 | "id": 18, 658 | "type": "ApplyInstantIDAdvanced", 659 | "pos": [ 660 | 935.8727416992188, 661 | 1338.8580322265625 662 | ], 663 | "size": [ 664 | 257.9229736328125, 665 | 338 666 | ], 667 | "flags": {}, 668 | "order": 14, 669 | "mode": 0, 670 | "inputs": [ 671 | { 672 | "name": "instantid", 673 | "type": "INSTANTID", 674 | "link": 25 675 | }, 676 | { 677 | "name": "insightface", 678 | "type": "FACEANALYSIS", 679 | "link": 26 680 | }, 681 | { 682 | "name": "control_net", 683 | "type": "CONTROL_NET", 684 | "link": 27 685 | }, 686 | { 687 | "name": "image", 688 | "type": "IMAGE", 689 | "link": 29 690 | }, 691 | { 692 | "name": "model", 693 | "type": "MODEL", 694 | "link": 30 695 | }, 696 | { 697 | "name": "positive", 698 | "type": "CONDITIONING", 699 | "link": 33 700 | }, 701 | { 702 | "name": "negative", 703 | "type": "CONDITIONING", 704 | "link": 34 705 | }, 706 | { 707 | "name": "image_kps", 708 | "shape": 7, 709 | "type": "IMAGE", 710 | "link": 35 711 | }, 712 | { 713 | "name": "mask", 714 | "shape": 7, 715 | "type": "MASK", 716 | "link": null 717 | } 718 | ], 719 | "outputs": [ 720 | { 721 | "name": "MODEL", 722 | "type": "MODEL", 723 | "links": null 724 | }, 725 | { 726 | "name": "positive", 727 | "type": "CONDITIONING", 728 | "links": [ 729 | 31 730 | ] 731 | }, 732 | { 733 | "name": "negative", 734 | "type": "CONDITIONING", 735 | "links": [ 736 | 32 737 | ] 738 | } 739 | ], 740 | "properties": { 741 | "Node name for S&R": "ApplyInstantIDAdvanced" 742 | }, 743 | "widgets_values": [ 744 | 0, 745 | 0.6000000000000001, 746 | 0, 747 | 1, 748 | 0, 749 | "average" 750 | ] 751 | }, 752 | { 753 | "id": 9, 754 | "type": "HyperLoRAApplyLoRA", 755 | "pos": [ 756 | 1298.61474609375, 757 | 677.2681884765625 758 | ], 759 | "size": [ 760 | 242.75352478027344, 761 | 78 762 | ], 763 | "flags": {}, 764 | "order": 17, 765 | "mode": 0, 766 | "inputs": [ 767 | { 768 | "name": "model", 769 | "type": "MODEL", 770 | "link": 11 771 | }, 772 | { 773 | "name": "lora", 774 | "type": "LORA", 775 | "link": 10 776 | } 777 | ], 778 | "outputs": [ 779 | { 780 | "name": "MODEL", 781 | "type": "MODEL", 782 | "links": [ 783 | 13 784 | ] 785 | } 786 | ], 787 | "properties": { 788 | "Node name for S&R": "HyperLoRAApplyLoRA" 789 | }, 790 | "widgets_values": [ 791 | 0.85 792 | ] 793 | }, 794 | { 795 | "id": 12, 796 | "type": "BNK_CLIPTextEncodeAdvanced", 797 | "pos": [ 798 | 904.4961547851562, 799 | 813.8724365234375 800 | ], 801 | "size": [ 802 | 430.8000183105469, 803 | 200 804 | ], 805 | "flags": {}, 806 | "order": 11, 807 | "mode": 0, 808 | "inputs": [ 809 | { 810 | "name": "clip", 811 | "type": "CLIP", 812 | "link": 19 813 | } 814 | ], 815 | "outputs": [ 816 | { 817 | "name": "CONDITIONING", 818 | "type": "CONDITIONING", 819 | "links": [ 820 | 33 821 | ] 822 | } 823 | ], 824 | "properties": { 825 | "Node name for S&R": "BNK_CLIPTextEncodeAdvanced" 826 | }, 827 | "widgets_values": [ 828 | "fcsks fxhks fhyks, a black young woman, standing among the flowers", 829 | "length+mean", 830 | "A1111" 831 | ] 832 | }, 833 | { 834 | "id": 11, 835 | "type": "KSampler", 836 | "pos": [ 837 | 1721.9530029296875, 838 | 714.7071533203125 839 | ], 840 | "size": [ 841 | 315, 842 | 262 843 | ], 844 | "flags": {}, 845 | "order": 18, 846 | "mode": 0, 847 | "inputs": [ 848 | { 849 | "name": "model", 850 | "type": "MODEL", 851 | "link": 13 852 | }, 853 | { 854 | "name": "positive", 855 | "type": "CONDITIONING", 856 | "link": 31 857 | }, 858 | { 859 | "name": "negative", 860 | "type": "CONDITIONING", 861 | "link": 32 862 | }, 863 | { 864 | "name": "latent_image", 865 | "type": "LATENT", 866 | "link": 18 867 | } 868 | ], 869 | "outputs": [ 870 | { 871 | "name": "LATENT", 872 | "type": "LATENT", 873 | "links": [ 874 | 22 875 | ] 876 | } 877 | ], 878 | "properties": { 879 | "Node name for S&R": "KSampler" 880 | }, 881 | "widgets_values": [ 882 | 25168479591540, 883 | "fixed", 884 | 20, 885 | 3, 886 | "dpmpp_2m", 887 | "karras", 888 | 1 889 | ] 890 | } 891 | ], 892 | "links": [ 893 | [ 894 | 1, 895 | 2, 896 | 0, 897 | 3, 898 | 0, 899 | "HYPER_LORA_CONFIG" 900 | ], 901 | [ 902 | 2, 903 | 3, 904 | 0, 905 | 4, 906 | 0, 907 | "HYPER_LORA" 908 | ], 909 | [ 910 | 3, 911 | 5, 912 | 0, 913 | 4, 914 | 1, 915 | "IMAGE" 916 | ], 917 | [ 918 | 4, 919 | 6, 920 | 0, 921 | 5, 922 | 0, 923 | "IMAGE" 924 | ], 925 | [ 926 | 5, 927 | 4, 928 | 0, 929 | 7, 930 | 2, 931 | "FACE_ATTR" 932 | ], 933 | [ 934 | 6, 935 | 5, 936 | 0, 937 | 7, 938 | 1, 939 | "IMAGE" 940 | ], 941 | [ 942 | 7, 943 | 3, 944 | 0, 945 | 7, 946 | 0, 947 | "HYPER_LORA" 948 | ], 949 | [ 950 | 8, 951 | 7, 952 | 0, 953 | 8, 954 | 1, 955 | "ID_COND" 956 | ], 957 | [ 958 | 9, 959 | 3, 960 | 0, 961 | 8, 962 | 0, 963 | "HYPER_LORA" 964 | ], 965 | [ 966 | 10, 967 | 8, 968 | 0, 969 | 9, 970 | 1, 971 | "LORA" 972 | ], 973 | [ 974 | 11, 975 | 1, 976 | 0, 977 | 9, 978 | 0, 979 | "MODEL" 980 | ], 981 | [ 982 | 13, 983 | 9, 984 | 0, 985 | 11, 986 | 0, 987 | "MODEL" 988 | ], 989 | [ 990 | 18, 991 | 14, 992 | 0, 993 | 11, 994 | 3, 995 | "LATENT" 996 | ], 997 | [ 998 | 19, 999 | 15, 1000 | 0, 1001 | 12, 1002 | 0, 1003 | "CLIP" 1004 | ], 1005 | [ 1006 | 20, 1007 | 15, 1008 | 0, 1009 | 13, 1010 | 0, 1011 | "CLIP" 1012 | ], 1013 | [ 1014 | 21, 1015 | 1, 1016 | 1, 1017 | 15, 1018 | 0, 1019 | "CLIP" 1020 | ], 1021 | [ 1022 | 22, 1023 | 11, 1024 | 0, 1025 | 16, 1026 | 0, 1027 | "LATENT" 1028 | ], 1029 | [ 1030 | 23, 1031 | 1, 1032 | 2, 1033 | 16, 1034 | 1, 1035 | "VAE" 1036 | ], 1037 | [ 1038 | 24, 1039 | 16, 1040 | 0, 1041 | 17, 1042 | 0, 1043 | "IMAGE" 1044 | ], 1045 | [ 1046 | 25, 1047 | 19, 1048 | 0, 1049 | 18, 1050 | 0, 1051 | "INSTANTID" 1052 | ], 1053 | [ 1054 | 26, 1055 | 20, 1056 | 0, 1057 | 18, 1058 | 1, 1059 | "FACEANALYSIS" 1060 | ], 1061 | [ 1062 | 27, 1063 | 21, 1064 | 0, 1065 | 18, 1066 | 2, 1067 | "CONTROL_NET" 1068 | ], 1069 | [ 1070 | 29, 1071 | 5, 1072 | 0, 1073 | 18, 1074 | 3, 1075 | "IMAGE" 1076 | ], 1077 | [ 1078 | 30, 1079 | 1, 1080 | 0, 1081 | 18, 1082 | 4, 1083 | "MODEL" 1084 | ], 1085 | [ 1086 | 31, 1087 | 18, 1088 | 1, 1089 | 11, 1090 | 1, 1091 | "CONDITIONING" 1092 | ], 1093 | [ 1094 | 32, 1095 | 18, 1096 | 2, 1097 | 11, 1098 | 2, 1099 | "CONDITIONING" 1100 | ], 1101 | [ 1102 | 33, 1103 | 12, 1104 | 0, 1105 | 18, 1106 | 5, 1107 | "CONDITIONING" 1108 | ], 1109 | [ 1110 | 34, 1111 | 13, 1112 | 0, 1113 | 18, 1114 | 6, 1115 | "CONDITIONING" 1116 | ], 1117 | [ 1118 | 35, 1119 | 23, 1120 | 0, 1121 | 18, 1122 | 7, 1123 | "IMAGE" 1124 | ] 1125 | ], 1126 | "groups": [], 1127 | "config": {}, 1128 | "extra": { 1129 | "ds": { 1130 | "scale": 0.31863081771035695, 1131 | "offset": [ 1132 | 1583.8546113074847, 1133 | 577.0047932090052 1134 | ] 1135 | }, 1136 | "frontendVersion": "1.16.9" 1137 | }, 1138 | "version": 0.4 1139 | } -------------------------------------------------------------------------------- /assets/HyperLoRA-T2I-ConceptSlider.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "b3c6f1fb-6d5e-494d-a6eb-eff4a1020dac", 3 | "revision": 0, 4 | "last_node_id": 27, 5 | "last_link_id": 45, 6 | "nodes": [ 7 | { 8 | "id": 14, 9 | "type": "EmptyLatentImage", 10 | "pos": [ 11 | 1387.7691650390625, 12 | 1137.106201171875 13 | ], 14 | "size": [ 15 | 210, 16 | 106 17 | ], 18 | "flags": {}, 19 | "order": 0, 20 | "mode": 0, 21 | "inputs": [], 22 | "outputs": [ 23 | { 24 | "name": "LATENT", 25 | "type": "LATENT", 26 | "links": [ 27 | 18 28 | ] 29 | } 30 | ], 31 | "properties": { 32 | "Node name for S&R": "EmptyLatentImage" 33 | }, 34 | "widgets_values": [ 35 | 1024, 36 | 1024, 37 | 1 38 | ] 39 | }, 40 | { 41 | "id": 16, 42 | "type": "VAEDecode", 43 | "pos": [ 44 | 2076.439697265625, 45 | 815.1502075195312 46 | ], 47 | "size": [ 48 | 162.50253295898438, 49 | 47.082061767578125 50 | ], 51 | "flags": {}, 52 | "order": 18, 53 | "mode": 0, 54 | "inputs": [ 55 | { 56 | "name": "samples", 57 | "type": "LATENT", 58 | "link": 22 59 | }, 60 | { 61 | "name": "vae", 62 | "type": "VAE", 63 | "link": 23 64 | } 65 | ], 66 | "outputs": [ 67 | { 68 | "name": "IMAGE", 69 | "type": "IMAGE", 70 | "links": [ 71 | 25 72 | ] 73 | } 74 | ], 75 | "properties": { 76 | "Node name for S&R": "VAEDecode" 77 | }, 78 | "widgets_values": [] 79 | }, 80 | { 81 | "id": 17, 82 | "type": "PreviewImage", 83 | "pos": [ 84 | 2817.593994140625, 85 | 467.689208984375 86 | ], 87 | "size": [ 88 | 597.0068359375, 89 | 650.1481323242188 90 | ], 91 | "flags": {}, 92 | "order": 20, 93 | "mode": 0, 94 | "inputs": [ 95 | { 96 | "name": "images", 97 | "type": "IMAGE", 98 | "link": 26 99 | } 100 | ], 101 | "outputs": [], 102 | "properties": { 103 | "Node name for S&R": "PreviewImage" 104 | }, 105 | "widgets_values": [] 106 | }, 107 | { 108 | "id": 15, 109 | "type": "CLIPSetLastLayer", 110 | "pos": [ 111 | 546.428466796875, 112 | 984.0955200195312 113 | ], 114 | "size": [ 115 | 243.56906127929688, 116 | 61.31538772583008 117 | ], 118 | "flags": {}, 119 | "order": 7, 120 | "mode": 0, 121 | "inputs": [ 122 | { 123 | "name": "clip", 124 | "type": "CLIP", 125 | "link": 21 126 | } 127 | ], 128 | "outputs": [ 129 | { 130 | "name": "CLIP", 131 | "type": "CLIP", 132 | "links": [ 133 | 19, 134 | 20, 135 | 29 136 | ] 137 | } 138 | ], 139 | "properties": { 140 | "Node name for S&R": "CLIPSetLastLayer" 141 | }, 142 | "widgets_values": [ 143 | -2 144 | ] 145 | }, 146 | { 147 | "id": 1, 148 | "type": "CheckpointLoaderSimple", 149 | "pos": [ 150 | 453.893310546875, 151 | 679.7804565429688 152 | ], 153 | "size": [ 154 | 366.26171875, 155 | 98 156 | ], 157 | "flags": {}, 158 | "order": 1, 159 | "mode": 0, 160 | "inputs": [], 161 | "outputs": [ 162 | { 163 | "name": "MODEL", 164 | "type": "MODEL", 165 | "links": [ 166 | 11 167 | ] 168 | }, 169 | { 170 | "name": "CLIP", 171 | "type": "CLIP", 172 | "links": [ 173 | 21 174 | ] 175 | }, 176 | { 177 | "name": "VAE", 178 | "type": "VAE", 179 | "links": [ 180 | 23, 181 | 30 182 | ] 183 | } 184 | ], 185 | "properties": { 186 | "Node name for S&R": "CheckpointLoaderSimple" 187 | }, 188 | "widgets_values": [ 189 | "RealVisXL_v4_BakedVAE.safetensors" 190 | ] 191 | }, 192 | { 193 | "id": 13, 194 | "type": "BNK_CLIPTextEncodeAdvanced", 195 | "pos": [ 196 | 902.450439453125, 197 | 1075.2142333984375 198 | ], 199 | "size": [ 200 | 430.8000183105469, 201 | 200 202 | ], 203 | "flags": {}, 204 | "order": 12, 205 | "mode": 0, 206 | "inputs": [ 207 | { 208 | "name": "clip", 209 | "type": "CLIP", 210 | "link": 20 211 | } 212 | ], 213 | "outputs": [ 214 | { 215 | "name": "CONDITIONING", 216 | "type": "CONDITIONING", 217 | "links": [ 218 | 17, 219 | 32 220 | ] 221 | } 222 | ], 223 | "properties": { 224 | "Node name for S&R": "BNK_CLIPTextEncodeAdvanced" 225 | }, 226 | "widgets_values": [ 227 | "big breast, nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, bad feet", 228 | "length+mean", 229 | "A1111" 230 | ] 231 | }, 232 | { 233 | "id": 18, 234 | "type": "FaceDetailer", 235 | "pos": [ 236 | 2325.718505859375, 237 | 270.2817687988281 238 | ], 239 | "size": [ 240 | 413.20001220703125, 241 | 960 242 | ], 243 | "flags": {}, 244 | "order": 19, 245 | "mode": 0, 246 | "inputs": [ 247 | { 248 | "name": "image", 249 | "type": "IMAGE", 250 | "link": 25 251 | }, 252 | { 253 | "name": "model", 254 | "type": "MODEL", 255 | "link": 41 256 | }, 257 | { 258 | "name": "clip", 259 | "type": "CLIP", 260 | "link": 29 261 | }, 262 | { 263 | "name": "vae", 264 | "type": "VAE", 265 | "link": 30 266 | }, 267 | { 268 | "name": "positive", 269 | "type": "CONDITIONING", 270 | "link": 31 271 | }, 272 | { 273 | "name": "negative", 274 | "type": "CONDITIONING", 275 | "link": 32 276 | }, 277 | { 278 | "name": "bbox_detector", 279 | "type": "BBOX_DETECTOR", 280 | "link": 27 281 | }, 282 | { 283 | "name": "sam_model_opt", 284 | "shape": 7, 285 | "type": "SAM_MODEL", 286 | "link": null 287 | }, 288 | { 289 | "name": "segm_detector_opt", 290 | "shape": 7, 291 | "type": "SEGM_DETECTOR", 292 | "link": null 293 | }, 294 | { 295 | "name": "detailer_hook", 296 | "shape": 7, 297 | "type": "DETAILER_HOOK", 298 | "link": null 299 | }, 300 | { 301 | "name": "scheduler_func_opt", 302 | "shape": 7, 303 | "type": "SCHEDULER_FUNC", 304 | "link": null 305 | } 306 | ], 307 | "outputs": [ 308 | { 309 | "name": "image", 310 | "type": "IMAGE", 311 | "links": [ 312 | 26 313 | ] 314 | }, 315 | { 316 | "name": "cropped_refined", 317 | "shape": 6, 318 | "type": "IMAGE", 319 | "links": null 320 | }, 321 | { 322 | "name": "cropped_enhanced_alpha", 323 | "shape": 6, 324 | "type": "IMAGE", 325 | "links": null 326 | }, 327 | { 328 | "name": "mask", 329 | "type": "MASK", 330 | "links": null 331 | }, 332 | { 333 | "name": "detailer_pipe", 334 | "type": "DETAILER_PIPE", 335 | "links": null 336 | }, 337 | { 338 | "name": "cnet_images", 339 | "shape": 6, 340 | "type": "IMAGE", 341 | "links": null 342 | } 343 | ], 344 | "properties": { 345 | "Node name for S&R": "FaceDetailer" 346 | }, 347 | "widgets_values": [ 348 | 896, 349 | true, 350 | 896, 351 | 97030315765072, 352 | "fixed", 353 | 10, 354 | 5, 355 | "dpmpp_2m", 356 | "karras", 357 | 0.5, 358 | 5, 359 | true, 360 | true, 361 | 0.5, 362 | 10, 363 | 2, 364 | "center-1", 365 | 0, 366 | 0.93, 367 | 0, 368 | 0.7, 369 | "False", 370 | 10, 371 | "", 372 | 1, 373 | false, 374 | 0, 375 | false, 376 | false 377 | ] 378 | }, 379 | { 380 | "id": 19, 381 | "type": "UltralyticsDetectorProvider", 382 | "pos": [ 383 | 2350.880615234375, 384 | 138.29702758789062 385 | ], 386 | "size": [ 387 | 340.20001220703125, 388 | 78 389 | ], 390 | "flags": {}, 391 | "order": 2, 392 | "mode": 0, 393 | "inputs": [], 394 | "outputs": [ 395 | { 396 | "name": "BBOX_DETECTOR", 397 | "type": "BBOX_DETECTOR", 398 | "links": [ 399 | 27 400 | ] 401 | }, 402 | { 403 | "name": "SEGM_DETECTOR", 404 | "type": "SEGM_DETECTOR", 405 | "links": null 406 | } 407 | ], 408 | "properties": { 409 | "Node name for S&R": "UltralyticsDetectorProvider" 410 | }, 411 | "widgets_values": [ 412 | "bbox/face_yolov8m.pt" 413 | ] 414 | }, 415 | { 416 | "id": 6, 417 | "type": "LoadImage", 418 | "pos": [ 419 | 103.46822357177734, 420 | 353.53076171875 421 | ], 422 | "size": [ 423 | 315, 424 | 314 425 | ], 426 | "flags": {}, 427 | "order": 3, 428 | "mode": 0, 429 | "inputs": [], 430 | "outputs": [ 431 | { 432 | "name": "IMAGE", 433 | "type": "IMAGE", 434 | "links": [ 435 | 4 436 | ] 437 | }, 438 | { 439 | "name": "MASK", 440 | "type": "MASK", 441 | "links": null 442 | } 443 | ], 444 | "properties": { 445 | "Node name for S&R": "LoadImage" 446 | }, 447 | "widgets_values": [ 448 | "id-02.png", 449 | "image" 450 | ] 451 | }, 452 | { 453 | "id": 12, 454 | "type": "BNK_CLIPTextEncodeAdvanced", 455 | "pos": [ 456 | 904.4961547851562, 457 | 813.8724365234375 458 | ], 459 | "size": [ 460 | 430.8000183105469, 461 | 200 462 | ], 463 | "flags": {}, 464 | "order": 11, 465 | "mode": 0, 466 | "inputs": [ 467 | { 468 | "name": "clip", 469 | "type": "CLIP", 470 | "link": 19 471 | } 472 | ], 473 | "outputs": [ 474 | { 475 | "name": "CONDITIONING", 476 | "type": "CONDITIONING", 477 | "links": [ 478 | 16, 479 | 31 480 | ] 481 | } 482 | ], 483 | "properties": { 484 | "Node name for S&R": "BNK_CLIPTextEncodeAdvanced" 485 | }, 486 | "widgets_values": [ 487 | "fcsks fxhks fhyks, a young woman, wearing wedding dress, at church", 488 | "length+mean", 489 | "A1111" 490 | ] 491 | }, 492 | { 493 | "id": 11, 494 | "type": "KSampler", 495 | "pos": [ 496 | 1716.4571533203125, 497 | 698.2420043945312 498 | ], 499 | "size": [ 500 | 315, 501 | 262 502 | ], 503 | "flags": {}, 504 | "order": 17, 505 | "mode": 0, 506 | "inputs": [ 507 | { 508 | "name": "model", 509 | "type": "MODEL", 510 | "link": 40 511 | }, 512 | { 513 | "name": "positive", 514 | "type": "CONDITIONING", 515 | "link": 16 516 | }, 517 | { 518 | "name": "negative", 519 | "type": "CONDITIONING", 520 | "link": 17 521 | }, 522 | { 523 | "name": "latent_image", 524 | "type": "LATENT", 525 | "link": 18 526 | } 527 | ], 528 | "outputs": [ 529 | { 530 | "name": "LATENT", 531 | "type": "LATENT", 532 | "links": [ 533 | 22 534 | ] 535 | } 536 | ], 537 | "properties": { 538 | "Node name for S&R": "KSampler" 539 | }, 540 | "widgets_values": [ 541 | 56761277541164, 542 | "fixed", 543 | 20, 544 | 5, 545 | "dpmpp_2m", 546 | "karras", 547 | 1 548 | ] 549 | }, 550 | { 551 | "id": 5, 552 | "type": "ImpactMakeImageBatch", 553 | "pos": [ 554 | 484.4687194824219, 555 | 484.53973388671875 556 | ], 557 | "size": [ 558 | 176.5312042236328, 559 | 46 560 | ], 561 | "flags": {}, 562 | "order": 8, 563 | "mode": 0, 564 | "inputs": [ 565 | { 566 | "name": "image1", 567 | "type": "IMAGE", 568 | "link": 4 569 | }, 570 | { 571 | "name": "image2", 572 | "type": "IMAGE", 573 | "link": null 574 | } 575 | ], 576 | "outputs": [ 577 | { 578 | "name": "IMAGE", 579 | "type": "IMAGE", 580 | "links": [ 581 | 34 582 | ] 583 | } 584 | ], 585 | "properties": { 586 | "Node name for S&R": "ImpactMakeImageBatch" 587 | }, 588 | "widgets_values": [] 589 | }, 590 | { 591 | "id": 21, 592 | "type": "HyperLoRAUniGenerateIDLoRA", 593 | "pos": [ 594 | 725.1944580078125, 595 | 327.50225830078125 596 | ], 597 | "size": [ 598 | 252, 599 | 102 600 | ], 601 | "flags": {}, 602 | "order": 13, 603 | "mode": 0, 604 | "inputs": [ 605 | { 606 | "name": "hyper_lora", 607 | "type": "HYPER_LORA", 608 | "link": 33 609 | }, 610 | { 611 | "name": "images", 612 | "type": "IMAGE", 613 | "link": 34 614 | } 615 | ], 616 | "outputs": [ 617 | { 618 | "name": "LORA", 619 | "type": "LORA", 620 | "links": [ 621 | 35 622 | ] 623 | } 624 | ], 625 | "properties": { 626 | "Node name for S&R": "HyperLoRAUniGenerateIDLoRA" 627 | }, 628 | "widgets_values": [ 629 | false, 630 | true 631 | ] 632 | }, 633 | { 634 | "id": 9, 635 | "type": "HyperLoRAApplyLoRA", 636 | "pos": [ 637 | 762.0117797851562, 638 | 525.0556030273438 639 | ], 640 | "size": [ 641 | 242.75352478027344, 642 | 78 643 | ], 644 | "flags": {}, 645 | "order": 14, 646 | "mode": 0, 647 | "inputs": [ 648 | { 649 | "name": "model", 650 | "type": "MODEL", 651 | "link": 11 652 | }, 653 | { 654 | "name": "lora", 655 | "type": "LORA", 656 | "link": 35 657 | } 658 | ], 659 | "outputs": [ 660 | { 661 | "name": "MODEL", 662 | "type": "MODEL", 663 | "links": [ 664 | 39 665 | ] 666 | } 667 | ], 668 | "properties": { 669 | "Node name for S&R": "HyperLoRAApplyLoRA" 670 | }, 671 | "widgets_values": [ 672 | 0.85 673 | ] 674 | }, 675 | { 676 | "id": 20, 677 | "type": "HyperLoRAUniLoader", 678 | "pos": [ 679 | 377.7908630371094, 680 | -11.700423240661621 681 | ], 682 | "size": [ 683 | 346.6282653808594, 684 | 178 685 | ], 686 | "flags": {}, 687 | "order": 4, 688 | "mode": 0, 689 | "inputs": [], 690 | "outputs": [ 691 | { 692 | "name": "HYPER_LORA", 693 | "type": "HYPER_LORA", 694 | "links": [ 695 | 33, 696 | 42, 697 | 43 698 | ] 699 | } 700 | ], 701 | "properties": { 702 | "Node name for S&R": "HyperLoRAUniLoader" 703 | }, 704 | "widgets_values": [ 705 | "clip_vit_large_14_processor", 706 | "clip_vit_large_14", 707 | "clip + arcface", 708 | "antelopev2", 709 | "sdxl_hyper_id_lora_v1_fidelity", 710 | "fp16" 711 | ] 712 | }, 713 | { 714 | "id": 22, 715 | "type": "HyperLoRAUniGenerateIDLoRA", 716 | "pos": [ 717 | 1047.5362548828125, 718 | 363.244873046875 719 | ], 720 | "size": [ 721 | 252, 722 | 102 723 | ], 724 | "flags": {}, 725 | "order": 9, 726 | "mode": 0, 727 | "inputs": [ 728 | { 729 | "name": "hyper_lora", 730 | "type": "HYPER_LORA", 731 | "link": 42 732 | }, 733 | { 734 | "name": "images", 735 | "type": "IMAGE", 736 | "link": 44 737 | } 738 | ], 739 | "outputs": [ 740 | { 741 | "name": "LORA", 742 | "type": "LORA", 743 | "links": [ 744 | 36 745 | ] 746 | } 747 | ], 748 | "properties": { 749 | "Node name for S&R": "HyperLoRAUniGenerateIDLoRA" 750 | }, 751 | "widgets_values": [ 752 | false, 753 | true 754 | ] 755 | }, 756 | { 757 | "id": 23, 758 | "type": "HyperLoRAUniGenerateIDLoRA", 759 | "pos": [ 760 | 1332.7276611328125, 761 | 363.610595703125 762 | ], 763 | "size": [ 764 | 252, 765 | 102 766 | ], 767 | "flags": {}, 768 | "order": 10, 769 | "mode": 0, 770 | "inputs": [ 771 | { 772 | "name": "hyper_lora", 773 | "type": "HYPER_LORA", 774 | "link": 43 775 | }, 776 | { 777 | "name": "images", 778 | "type": "IMAGE", 779 | "link": 45 780 | } 781 | ], 782 | "outputs": [ 783 | { 784 | "name": "LORA", 785 | "type": "LORA", 786 | "links": [ 787 | 37 788 | ] 789 | } 790 | ], 791 | "properties": { 792 | "Node name for S&R": "HyperLoRAUniGenerateIDLoRA" 793 | }, 794 | "widgets_values": [ 795 | false, 796 | true 797 | ] 798 | }, 799 | { 800 | "id": 26, 801 | "type": "LoadImage", 802 | "pos": [ 803 | 993.3975830078125, 804 | -12.648544311523438 805 | ], 806 | "size": [ 807 | 315, 808 | 314 809 | ], 810 | "flags": {}, 811 | "order": 5, 812 | "mode": 0, 813 | "inputs": [], 814 | "outputs": [ 815 | { 816 | "name": "IMAGE", 817 | "type": "IMAGE", 818 | "links": [ 819 | 44 820 | ] 821 | }, 822 | { 823 | "name": "MASK", 824 | "type": "MASK", 825 | "links": null 826 | } 827 | ], 828 | "properties": { 829 | "Node name for S&R": "LoadImage" 830 | }, 831 | "widgets_values": [ 832 | "slider0.png", 833 | "image" 834 | ] 835 | }, 836 | { 837 | "id": 27, 838 | "type": "LoadImage", 839 | "pos": [ 840 | 1324.1905517578125, 841 | -11.347763061523438 842 | ], 843 | "size": [ 844 | 315, 845 | 314 846 | ], 847 | "flags": {}, 848 | "order": 6, 849 | "mode": 0, 850 | "inputs": [], 851 | "outputs": [ 852 | { 853 | "name": "IMAGE", 854 | "type": "IMAGE", 855 | "links": [ 856 | 45 857 | ] 858 | }, 859 | { 860 | "name": "MASK", 861 | "type": "MASK", 862 | "links": null 863 | } 864 | ], 865 | "properties": { 866 | "Node name for S&R": "LoadImage" 867 | }, 868 | "widgets_values": [ 869 | "slider1.png", 870 | "image" 871 | ] 872 | }, 873 | { 874 | "id": 24, 875 | "type": "HyperLoRAApplyLoRA", 876 | "pos": [ 877 | 1047.8970947265625, 878 | 524.62548828125 879 | ], 880 | "size": [ 881 | 242.75352478027344, 882 | 78 883 | ], 884 | "flags": {}, 885 | "order": 15, 886 | "mode": 0, 887 | "inputs": [ 888 | { 889 | "name": "model", 890 | "type": "MODEL", 891 | "link": 39 892 | }, 893 | { 894 | "name": "lora", 895 | "type": "LORA", 896 | "link": 36 897 | } 898 | ], 899 | "outputs": [ 900 | { 901 | "name": "MODEL", 902 | "type": "MODEL", 903 | "links": [ 904 | 38 905 | ] 906 | } 907 | ], 908 | "properties": { 909 | "Node name for S&R": "HyperLoRAApplyLoRA" 910 | }, 911 | "widgets_values": [ 912 | -0.7000000000000001 913 | ] 914 | }, 915 | { 916 | "id": 25, 917 | "type": "HyperLoRAApplyLoRA", 918 | "pos": [ 919 | 1335.8204345703125, 920 | 523.98828125 921 | ], 922 | "size": [ 923 | 242.75352478027344, 924 | 78 925 | ], 926 | "flags": {}, 927 | "order": 16, 928 | "mode": 0, 929 | "inputs": [ 930 | { 931 | "name": "model", 932 | "type": "MODEL", 933 | "link": 38 934 | }, 935 | { 936 | "name": "lora", 937 | "type": "LORA", 938 | "link": 37 939 | } 940 | ], 941 | "outputs": [ 942 | { 943 | "name": "MODEL", 944 | "type": "MODEL", 945 | "links": [ 946 | 40, 947 | 41 948 | ] 949 | } 950 | ], 951 | "properties": { 952 | "Node name for S&R": "HyperLoRAApplyLoRA" 953 | }, 954 | "widgets_values": [ 955 | 0.7000000000000001 956 | ] 957 | } 958 | ], 959 | "links": [ 960 | [ 961 | 4, 962 | 6, 963 | 0, 964 | 5, 965 | 0, 966 | "IMAGE" 967 | ], 968 | [ 969 | 11, 970 | 1, 971 | 0, 972 | 9, 973 | 0, 974 | "MODEL" 975 | ], 976 | [ 977 | 16, 978 | 12, 979 | 0, 980 | 11, 981 | 1, 982 | "CONDITIONING" 983 | ], 984 | [ 985 | 17, 986 | 13, 987 | 0, 988 | 11, 989 | 2, 990 | "CONDITIONING" 991 | ], 992 | [ 993 | 18, 994 | 14, 995 | 0, 996 | 11, 997 | 3, 998 | "LATENT" 999 | ], 1000 | [ 1001 | 19, 1002 | 15, 1003 | 0, 1004 | 12, 1005 | 0, 1006 | "CLIP" 1007 | ], 1008 | [ 1009 | 20, 1010 | 15, 1011 | 0, 1012 | 13, 1013 | 0, 1014 | "CLIP" 1015 | ], 1016 | [ 1017 | 21, 1018 | 1, 1019 | 1, 1020 | 15, 1021 | 0, 1022 | "CLIP" 1023 | ], 1024 | [ 1025 | 22, 1026 | 11, 1027 | 0, 1028 | 16, 1029 | 0, 1030 | "LATENT" 1031 | ], 1032 | [ 1033 | 23, 1034 | 1, 1035 | 2, 1036 | 16, 1037 | 1, 1038 | "VAE" 1039 | ], 1040 | [ 1041 | 25, 1042 | 16, 1043 | 0, 1044 | 18, 1045 | 0, 1046 | "IMAGE" 1047 | ], 1048 | [ 1049 | 26, 1050 | 18, 1051 | 0, 1052 | 17, 1053 | 0, 1054 | "IMAGE" 1055 | ], 1056 | [ 1057 | 27, 1058 | 19, 1059 | 0, 1060 | 18, 1061 | 6, 1062 | "BBOX_DETECTOR" 1063 | ], 1064 | [ 1065 | 29, 1066 | 15, 1067 | 0, 1068 | 18, 1069 | 2, 1070 | "CLIP" 1071 | ], 1072 | [ 1073 | 30, 1074 | 1, 1075 | 2, 1076 | 18, 1077 | 3, 1078 | "VAE" 1079 | ], 1080 | [ 1081 | 31, 1082 | 12, 1083 | 0, 1084 | 18, 1085 | 4, 1086 | "CONDITIONING" 1087 | ], 1088 | [ 1089 | 32, 1090 | 13, 1091 | 0, 1092 | 18, 1093 | 5, 1094 | "CONDITIONING" 1095 | ], 1096 | [ 1097 | 33, 1098 | 20, 1099 | 0, 1100 | 21, 1101 | 0, 1102 | "HYPER_LORA" 1103 | ], 1104 | [ 1105 | 34, 1106 | 5, 1107 | 0, 1108 | 21, 1109 | 1, 1110 | "IMAGE" 1111 | ], 1112 | [ 1113 | 35, 1114 | 21, 1115 | 0, 1116 | 9, 1117 | 1, 1118 | "LORA" 1119 | ], 1120 | [ 1121 | 36, 1122 | 22, 1123 | 0, 1124 | 24, 1125 | 1, 1126 | "LORA" 1127 | ], 1128 | [ 1129 | 37, 1130 | 23, 1131 | 0, 1132 | 25, 1133 | 1, 1134 | "LORA" 1135 | ], 1136 | [ 1137 | 38, 1138 | 24, 1139 | 0, 1140 | 25, 1141 | 0, 1142 | "MODEL" 1143 | ], 1144 | [ 1145 | 39, 1146 | 9, 1147 | 0, 1148 | 24, 1149 | 0, 1150 | "MODEL" 1151 | ], 1152 | [ 1153 | 40, 1154 | 25, 1155 | 0, 1156 | 11, 1157 | 0, 1158 | "MODEL" 1159 | ], 1160 | [ 1161 | 41, 1162 | 25, 1163 | 0, 1164 | 18, 1165 | 1, 1166 | "MODEL" 1167 | ], 1168 | [ 1169 | 42, 1170 | 20, 1171 | 0, 1172 | 22, 1173 | 0, 1174 | "HYPER_LORA" 1175 | ], 1176 | [ 1177 | 43, 1178 | 20, 1179 | 0, 1180 | 23, 1181 | 0, 1182 | "HYPER_LORA" 1183 | ], 1184 | [ 1185 | 44, 1186 | 26, 1187 | 0, 1188 | 22, 1189 | 1, 1190 | "IMAGE" 1191 | ], 1192 | [ 1193 | 45, 1194 | 27, 1195 | 0, 1196 | 23, 1197 | 1, 1198 | "IMAGE" 1199 | ] 1200 | ], 1201 | "groups": [], 1202 | "config": {}, 1203 | "extra": { 1204 | "ds": { 1205 | "scale": 0.28966437973668824, 1206 | "offset": [ 1207 | 1342.4257592427837, 1208 | 1074.9478905573874 1209 | ] 1210 | }, 1211 | "frontendVersion": "1.16.9" 1212 | }, 1213 | "version": 0.4 1214 | } -------------------------------------------------------------------------------- /hyperlora/nodes.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025 Bytedance Ltd. and/or its affiliates. All rights reserved. 2 | 3 | # Licensed under the GNU General Public License, Version 3.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | 7 | # https://www.gnu.org/licenses/gpl-3.0 8 | 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import cv2 16 | import folder_paths 17 | import json 18 | import os 19 | import numpy as np 20 | import torch 21 | import torch.nn as nn 22 | from comfy.model_management import get_torch_device 23 | from comfy.model_patcher import ModelPatcher 24 | from comfy.sd import load_lora_for_models 25 | from dataclasses import dataclass 26 | from insightface.app import FaceAnalysis 27 | from PIL import Image, ImageDraw, ImageFilter 28 | from safetensors.torch import load_file, save_file 29 | from .common import FaceAttrInfo, FaceAttrResp, images2tensor, tensor2images 30 | from .configs import HyperLoRAConfig 31 | from .modules import HyperLoRAModule, Resampler, Reshape 32 | from .node_fields import * 33 | 34 | 35 | @dataclass 36 | class HyperLoRA: 37 | image_processor = None 38 | image_encoder = None 39 | face_analyzer: FaceAnalysis = None 40 | resampler: nn.Module = None 41 | base_resampler: nn.Module = None 42 | id_projector: nn.Module = None 43 | hyper_lora_modules: nn.ModuleList = None 44 | hyper_lora_modules_info: dict = None 45 | has_clip_encoder: bool = False 46 | 47 | 48 | def list_models(model_type): 49 | full_folder = os.path.join(folder_paths.models_dir, model_type) 50 | models = [] 51 | if os.path.exists(full_folder): 52 | for fn in os.listdir(full_folder): 53 | full_path = os.path.join(full_folder, fn) 54 | if os.path.isdir(full_path) or os.path.islink(full_path): 55 | models.append(fn) 56 | if len(models) == 0: 57 | models.append('Not found!') 58 | return models 59 | 60 | def face_bbox(landmark: np.ndarray): 61 | x_min, y_min = landmark.min(axis=0) 62 | x_max, y_max = landmark.max(axis=0) 63 | c_x = (x_min + x_max) * 0.5 64 | c_y = (y_min + y_max) * 0.5 65 | l = max(x_max - x_min, y_max - y_min) * 0.75 66 | c_y -= l * 0.125 67 | return (c_x, c_y), l 68 | 69 | def face_crop(image: Image.Image, landmark: np.ndarray, mask_scale: float = 1.0): 70 | OUTLINE_INDICES = [ 71 | 1, 9, 10, 11, 12, 13, 14, 15, 16, 2, 3, 4, 5, 6, 7, 8, 0, 72 | 24, 23, 22, 21, 20, 19, 18, 32, 31, 30, 29, 28, 27, 26, 25, 17, 73 | 101, 105, 104, 103, 102, 50, 51, 49, 48, 43 74 | ] 75 | # get mask by landmark 76 | pts = landmark[OUTLINE_INDICES] 77 | center = pts.mean(axis=0, keepdims=True) 78 | mask = Image.new('L', image.size, 0) 79 | draw = ImageDraw.Draw(mask) 80 | draw.polygon((pts - center) * mask_scale + center, fill=255) 81 | # crop image & mask 82 | x_min, y_min = pts.min(axis=0) 83 | x_max, y_max = pts.max(axis=0) 84 | l = max(x_max - x_min, y_max - y_min) * 0.8 85 | c_x, c_y = center[0] 86 | crop_image = image.crop((c_x - l, c_y - l, c_x + l, c_y + l)) 87 | crop_mask = mask.crop((c_x - l, c_y - l, c_x + l, c_y + l)) 88 | return (crop_image, crop_mask), (c_x, c_y), l 89 | 90 | 91 | class HyperLoRAConfigNode: 92 | 93 | @classmethod 94 | def INPUT_TYPES(cls): 95 | return inputs_def(required=[ 96 | enum_field('image_processor', options=list_models('hyper_lora/clip_processor')), 97 | enum_field('image_encoder', options=list_models('hyper_lora/clip_vit')), 98 | int_field('resampler.dim', default=1024, minimum=64, maximum=2048, step=32), 99 | int_field('resampler.dim_head', default=64, minimum=32, maximum=512, step=32), 100 | int_field('resampler.heads', default=12, minimum=4, maximum=32, step=4), 101 | int_field('resampler.depth', default=4, minimum=4, maximum=16, step=2), 102 | int_field('resampler.ff_mult', default=4, minimum=2, maximum=8, step=2), 103 | enum_field('encoder_types', options=[ 'clip', 'arcface', 'clip + arcface' ]), 104 | enum_field('face_analyzer', options=list_models('insightface/models')), 105 | int_field('id_embed_dim', default=512, minimum=128, maximum=1024, step=32), 106 | int_field('num_id_tokens', default=4, minimum=4, maximum=128, step=4), 107 | int_field('hyper_dim', default=128, minimum=32, maximum=1024, step=32), 108 | int_field('lora_rank', default=4, minimum=2, maximum=32, step=2), 109 | bool_field('has_base_lora', default=False) 110 | ]) 111 | 112 | RETURN_TYPES = ('HYPER_LORA_CONFIG', ) 113 | FUNCTION = 'execute' 114 | CATEGORY = 'HyperLoRA' 115 | 116 | def execute(self, **kwagrs): 117 | config_dict = { 118 | 'image_processor': { 119 | 'pretrained_model': os.path.join(folder_paths.models_dir, 'hyper_lora/clip_processor', kwagrs['image_processor']) 120 | }, 121 | 'image_encoder': { 122 | 'pretrained_model': os.path.join(folder_paths.models_dir, 'hyper_lora/clip_vit', kwagrs['image_encoder']) 123 | }, 124 | 'resampler': { 125 | 'dim': kwagrs['resampler.dim'], 126 | 'dim_head': kwagrs['resampler.dim_head'], 127 | 'heads': kwagrs['resampler.heads'], 128 | 'depth': kwagrs['resampler.depth'], 129 | 'ff_mult': kwagrs['resampler.ff_mult'] 130 | }, 131 | 'encoder_types': kwagrs['encoder_types'].split(' + '), 132 | 'face_analyzer': kwagrs['face_analyzer'], 133 | 'insightface_root': os.path.join(folder_paths.models_dir, 'insightface'), 134 | 'id_embed_dim': kwagrs['id_embed_dim'], 135 | 'num_id_tokens': kwagrs['num_id_tokens'], 136 | 'hyper_dim': kwagrs['hyper_dim'], 137 | 'lora_rank': kwagrs['lora_rank'], 138 | 'has_base_lora': kwagrs['has_base_lora'] 139 | } 140 | config = HyperLoRAConfig() 141 | config.from_dict(config_dict) 142 | config.print() 143 | return (config, ) 144 | 145 | 146 | class HyperLoRALoaderNode: 147 | 148 | @classmethod 149 | def INPUT_TYPES(cls): 150 | return inputs_def(required=[ 151 | custom_field('config', type_name='HYPER_LORA_CONFIG'), 152 | enum_field('model', options=list_models('hyper_lora/hyper_lora')), 153 | enum_field('dtype', options=[ 'fp16', 'bf16', 'fp32' ]) 154 | ]) 155 | 156 | RETURN_TYPES = ('HYPER_LORA', ) 157 | FUNCTION = 'execute' 158 | CATEGORY = 'HyperLoRA' 159 | 160 | def execute(self, config: HyperLoRAConfig, model, dtype): 161 | device = get_torch_device() 162 | full_folder = os.path.join(folder_paths.models_dir, 'hyper_lora/hyper_lora', model) 163 | hyper_lora = HyperLoRA() 164 | 165 | if dtype == 'fp16': 166 | dtype = torch.float16 167 | elif dtype == 'bf16': 168 | dtype = torch.bfloat16 169 | elif dtype == 'fp32': 170 | dtype = torch.float32 171 | 172 | # load clip vit 173 | if 'clip' in config.encoder_types or config.has_base_lora: 174 | hyper_lora.image_processor = config.image_processor.instantiate() 175 | hyper_lora.image_encoder = config.image_encoder.instantiate() 176 | hyper_lora.image_encoder.to(device, dtype).eval() 177 | hyper_lora.has_clip_encoder = ('clip' in config.encoder_types) 178 | 179 | # load hyper lora modules 180 | hyper_lora.hyper_lora_modules = nn.ModuleList() 181 | hyper_lora_modules_info_file = os.path.join(full_folder, 'hyper_lora_modules.json') 182 | assert os.path.isfile(hyper_lora_modules_info_file), 'HyperLoRA modules info file not found!' 183 | with open(hyper_lora_modules_info_file, 'rt') as f: 184 | hyper_lora_modules_info = json.load(f) 185 | hyper_lora.hyper_lora_modules_info = hyper_lora_modules_info 186 | for module_info in hyper_lora_modules_info.values(): 187 | hyper_lora.hyper_lora_modules.append(HyperLoRAModule( 188 | config.hyper_dim, module_info['hidden_size'], module_info['cross_attention_dim'], 189 | lora_rank=config.lora_rank, has_base_lora=config.has_base_lora 190 | )) 191 | hyper_lora_modules_file = os.path.join(full_folder, 'hyper_lora_modules.safetensors') 192 | assert os.path.isfile(hyper_lora_modules_file), 'HyperLoRA modules file not found!' 193 | hyper_lora.hyper_lora_modules.load_state_dict(load_file(hyper_lora_modules_file)) 194 | hyper_lora.hyper_lora_modules.to(device, dtype).eval() 195 | print('HyperLoRA modules loaded.') 196 | 197 | # load resampler 198 | hyper_lora.resampler = Resampler( 199 | dim=config.resampler.dim, 200 | depth=config.resampler.depth, 201 | dim_head=config.resampler.dim_head, 202 | heads=config.resampler.heads, 203 | num_queries=8 * len(hyper_lora.hyper_lora_modules), 204 | embedding_dim=hyper_lora.image_encoder.config.hidden_size if hyper_lora.has_clip_encoder else config.id_embed_dim, 205 | output_dim=config.hyper_dim, 206 | ff_mult=config.resampler.ff_mult, 207 | n_conds=len(config.encoder_types) 208 | ) 209 | resampler_file = os.path.join(full_folder, 'resampler.safetensors') 210 | assert os.path.isfile(resampler_file), 'Resampler file not found!' 211 | hyper_lora.resampler.load_state_dict(load_file(resampler_file)) 212 | hyper_lora.resampler.to(device, dtype).eval() 213 | print('Resampler loaded.') 214 | 215 | # load base resampler 216 | if config.has_base_lora: 217 | hyper_lora.base_resampler = Resampler( 218 | dim=config.resampler.dim, 219 | depth=config.resampler.depth, 220 | dim_head=config.resampler.dim_head, 221 | heads=config.resampler.heads, 222 | num_queries=8 * len(hyper_lora.hyper_lora_modules), 223 | embedding_dim=hyper_lora.image_encoder.config.hidden_size, 224 | output_dim=config.hyper_dim, 225 | ff_mult=config.resampler.ff_mult, 226 | n_conds=1 227 | ) 228 | base_resampler_file = os.path.join(full_folder, 'base_resampler.safetensors') 229 | assert os.path.isfile(base_resampler_file), 'Base resampler file not found!' 230 | hyper_lora.base_resampler.load_state_dict(load_file(base_resampler_file)) 231 | hyper_lora.base_resampler.to(device, dtype).eval() 232 | print('Base resampler loaded.') 233 | 234 | # load id projector 235 | if 'arcface' in config.encoder_types: 236 | hyper_lora.id_projector = nn.Sequential( 237 | nn.Linear(config.id_embed_dim, hyper_lora.resampler.proj_in.in_features * config.num_id_tokens), 238 | Reshape((-1, config.num_id_tokens, hyper_lora.resampler.proj_in.in_features)), 239 | nn.LayerNorm(hyper_lora.resampler.proj_in.in_features) 240 | ) 241 | id_projector_file = os.path.join(full_folder, 'id_projector.safetensors') 242 | assert os.path.isfile(id_projector_file), 'ID projector file not found!' 243 | hyper_lora.id_projector.load_state_dict(load_file(id_projector_file)) 244 | hyper_lora.id_projector.to(device, dtype).eval() 245 | print('ID projector loaded.') 246 | 247 | hyper_lora.face_analyzer = FaceAnalysis(name=config.face_analyzer, root=config.insightface_root, providers=['CPUExecutionProvider']) 248 | hyper_lora.face_analyzer.prepare(ctx_id=0, det_size=(640, 640)) 249 | print('Face analyzer loaded.') 250 | 251 | return (hyper_lora, ) 252 | 253 | 254 | class HyperLoRAIDCondNode: 255 | 256 | @classmethod 257 | def INPUT_TYPES(cls): 258 | return inputs_def(required=[ 259 | custom_field('hyper_lora', type_name='HYPER_LORA'), 260 | image_field('images'), 261 | custom_field('face_attr', type_name='FACE_ATTR'), 262 | bool_field('grayscale', default=False), 263 | bool_field('remove_background', default=True) 264 | ]) 265 | 266 | RETURN_TYPES = ('ID_COND', 'IMAGE') 267 | FUNCTION = 'execute' 268 | CATEGORY = 'HyperLoRA' 269 | 270 | def make_id_cond(self, hyper_lora: HyperLoRA, image: Image.Image, face_attr: FaceAttrResp, grayscale, remove_background): 271 | if face_attr.n_face == 0: 272 | raise Exception('No face detected!') 273 | landmark = face_attr.faces[0].landmarks[:106, :] 274 | 275 | # face preprocess 276 | if remove_background: 277 | (crop_image, crop_mask), (c_x, c_y), l = face_crop(image, landmark, mask_scale=1.0) 278 | crop_mask = crop_mask.resize((512, 512)) 279 | crop_mask = crop_mask.filter(ImageFilter.GaussianBlur(radius=15)).resize(crop_image.size) 280 | face = Image.new('RGB', image.size, '#7f7f7f') 281 | face.paste(crop_image, (int(c_x - l), int(c_y - l)), crop_mask) 282 | else: face = image 283 | 284 | # for clip 285 | (c_x, c_y), l = face_bbox(landmark) 286 | face = face.crop((c_x - l, c_y - l, c_x + l, c_y + l)) 287 | if grayscale: 288 | face = face.convert('L') 289 | if hyper_lora.has_clip_encoder: 290 | id_image = hyper_lora.image_processor(face, return_tensors='pt').pixel_values 291 | else: id_image = None 292 | 293 | # for arcface 294 | l = l * 2.0 295 | image = image.crop((c_x - l, c_y - l, c_x + l, c_y + l)) 296 | if not hyper_lora.face_analyzer is None: 297 | hyper_lora.face_analyzer.det_model.input_size = (640, 640) 298 | face_list = hyper_lora.face_analyzer.get(cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR)) 299 | if len(face_list) == 0: 300 | raise Exception('No face detected!') 301 | id_embed = torch.from_numpy(face_list[0].normed_embedding).view(1, 1, 512) 302 | else: id_embed = None 303 | 304 | return id_image, id_embed, face.resize((512, 512)) 305 | 306 | def execute(self, hyper_lora: HyperLoRA, images: torch.Tensor, face_attr: list[FaceAttrResp], grayscale, remove_background): 307 | images = tensor2images(images) 308 | id_images, id_embeds, faces = [], [], [] 309 | for image, _face_attr in zip(images, face_attr): 310 | try: 311 | id_image, id_embed, face = self.make_id_cond(hyper_lora, image, _face_attr, grayscale, remove_background) 312 | if not id_image is None: 313 | id_images.append(id_image) 314 | if not id_embed is None: 315 | id_embeds.append(id_embed) 316 | faces.append(face) 317 | except: 318 | print('No face detected!') 319 | id_images = torch.cat(id_images, dim=0) if len(id_images) > 0 else None 320 | id_embeds = torch.cat(id_embeds, dim=0) if len(id_embeds) > 0 else None 321 | return [ id_images, id_embeds ], images2tensor(faces) 322 | 323 | 324 | class HyperLoRABaseCondNode: 325 | 326 | @classmethod 327 | def INPUT_TYPES(cls): 328 | return inputs_def(required=[ 329 | custom_field('hyper_lora', type_name='HYPER_LORA'), 330 | image_field('images'), 331 | custom_field('face_attr', type_name='FACE_ATTR'), 332 | bool_field('crop', default=True), 333 | str_field('crop_scale_LRTB', default='1,1,1,1'), 334 | bool_field('safe_crop', default=True) 335 | ]) 336 | 337 | RETURN_TYPES = ('BASE_COND', 'IMAGE') 338 | FUNCTION = 'execute' 339 | CATEGORY = 'HyperLoRA' 340 | 341 | def make_base_cond(self, hyper_lora: HyperLoRA, image: Image.Image, face_attr: FaceAttrResp, crop, crop_scale_LRTB, safe_crop): 342 | if face_attr.n_face == 0: 343 | raise Exception('No face detected!') 344 | landmark = face_attr.faces[0].landmarks[:106, :] 345 | 346 | # face preprocess 347 | (crop_image, crop_mask), (c_x, c_y), l = face_crop(image, landmark, mask_scale=1.4) 348 | _size = crop_image.size 349 | crop_image = crop_image.resize((512, 512)) 350 | crop_mask = crop_mask.resize((512, 512)) 351 | crop_image = crop_image.filter(ImageFilter.GaussianBlur(radius=45)).resize(_size) 352 | crop_mask = crop_mask.filter(ImageFilter.GaussianBlur(radius=15)).resize(_size) 353 | image.paste(crop_image, (int(c_x - l), int(c_y - l)), crop_mask) 354 | 355 | # crop 356 | if crop: 357 | (c_x, c_y), l = face_bbox(landmark) 358 | a, b, c, d = map(float, crop_scale_LRTB.split(',')) 359 | x1, y1, x2, y2 = c_x - l * a, c_y - l * c, c_x + l * b, c_y + l * d 360 | if safe_crop: 361 | x1, y1, x2, y2 = max(0, x1), max(0, y1), min(image.width, x2), min(image.height, y2) 362 | image = image.crop((x1, y1, x2, y2)) 363 | 364 | # for clip 365 | if not hyper_lora.base_resampler is None: 366 | base_cond = hyper_lora.image_processor(image, return_tensors='pt').pixel_values 367 | else: base_cond = None 368 | 369 | return base_cond, image 370 | 371 | 372 | def execute(self, hyper_lora: HyperLoRA, images: torch.Tensor, face_attr: list[FaceAttrResp], crop, crop_scale_LRTB, safe_crop): 373 | images = tensor2images(images) 374 | base_conds, base_images = [], [] 375 | for image, _face_attr in zip(images, face_attr): 376 | try: 377 | base_cond, base_image = self.make_base_cond(hyper_lora, image, _face_attr, crop, crop_scale_LRTB, safe_crop) 378 | if not base_cond is None: 379 | base_conds.append(base_cond) 380 | base_images.append(base_image) 381 | except: 382 | print('No face detected!') 383 | base_conds = torch.cat(base_conds, dim=0) if len(base_conds) > 0 else None 384 | return base_conds, images2tensor(base_images) 385 | 386 | 387 | class HyperLoRAGenerateIDLoRANode: 388 | 389 | @classmethod 390 | def INPUT_TYPES(cls): 391 | return inputs_def(required=[ 392 | custom_field('hyper_lora', type_name='HYPER_LORA'), 393 | custom_field('id_cond', type_name='ID_COND') 394 | ]) 395 | 396 | RETURN_TYPES = ('LORA', ) 397 | FUNCTION = 'execute' 398 | CATEGORY = 'HyperLoRA' 399 | 400 | @torch.no_grad() 401 | def execute(self, hyper_lora: HyperLoRA, id_cond): 402 | device = get_torch_device() 403 | dtype = hyper_lora.resampler.proj_in.weight.dtype 404 | 405 | id_image, id_embed = id_cond 406 | assert not id_image is None or not id_embed is None, 'ID condition is None!' 407 | if not id_embed is None: 408 | id_embed = hyper_lora.id_projector(id_embed.to(device, dtype)) 409 | if not id_image is None: 410 | conds = [ id_embed, hyper_lora.image_encoder(id_image.to(device, dtype), output_hidden_states=True).hidden_states[-2] ] 411 | else: 412 | conds = [ hyper_lora.image_encoder(id_image.to(device, dtype), output_hidden_states=True).hidden_states[-2], None ] 413 | tokens_list = hyper_lora.resampler(*conds).chunk(len(hyper_lora.hyper_lora_modules), dim=1) 414 | lora_weights = {} 415 | for name, module, tokens in zip(hyper_lora.hyper_lora_modules_info.keys(), hyper_lora.hyper_lora_modules, tokens_list): 416 | for key, (down, up) in module(tokens, mode='id').items(): 417 | lora_key = f'{name}_{key}' 418 | lora_weights[f'{lora_key}.alpha'] = torch.tensor(float(down.shape[0])) * 0.5 # lora rank // 2 419 | lora_weights[f'{lora_key}.lora_down.weight'] = down.cpu() 420 | lora_weights[f'{lora_key}.lora_up.weight'] = up.cpu() 421 | return (lora_weights, ) 422 | 423 | 424 | class HyperLoRAGenerateBaseLoRANode: 425 | 426 | @classmethod 427 | def INPUT_TYPES(cls): 428 | return inputs_def(required=[ 429 | custom_field('hyper_lora', type_name='HYPER_LORA'), 430 | custom_field('base_cond', type_name='BASE_COND') 431 | ]) 432 | 433 | RETURN_TYPES = ('LORA', ) 434 | FUNCTION = 'execute' 435 | CATEGORY = 'HyperLoRA' 436 | 437 | @torch.no_grad() 438 | def execute(self, hyper_lora: HyperLoRA, base_cond): 439 | device = get_torch_device() 440 | dtype = hyper_lora.resampler.proj_in.weight.dtype 441 | 442 | base_cond = hyper_lora.image_encoder(base_cond.to(device, dtype), output_hidden_states=True).hidden_states[-2] 443 | tokens_list = hyper_lora.base_resampler(base_cond).chunk(len(hyper_lora.hyper_lora_modules), dim=1) 444 | lora_weights = {} 445 | for name, module, tokens in zip(hyper_lora.hyper_lora_modules_info.keys(), hyper_lora.hyper_lora_modules, tokens_list): 446 | for key, (down, up) in module(tokens, mode='base').items(): 447 | lora_key = f'{name}_{key}' 448 | lora_weights[f'{lora_key}.alpha'] = torch.tensor(float(down.shape[0])) * 0.5 # lora rank // 2 449 | lora_weights[f'{lora_key}.lora_down.weight'] = down.cpu() 450 | lora_weights[f'{lora_key}.lora_up.weight'] = up.cpu() 451 | return (lora_weights, ) 452 | 453 | 454 | class HyperLoRAApplyLoRANode: 455 | 456 | @classmethod 457 | def INPUT_TYPES(cls): 458 | return inputs_def(required=[ 459 | custom_field('model', type_name='MODEL'), 460 | custom_field('lora', type_name='LORA'), 461 | float_field('weight', default=0.8, minimum=-1.5, maximum=1.5, step=0.01) 462 | ]) 463 | 464 | RETURN_TYPES = ('MODEL', ) 465 | FUNCTION = 'execute' 466 | CATEGORY = 'HyperLoRA' 467 | 468 | def execute(self, model: ModelPatcher, lora, weight): 469 | model, _ = load_lora_for_models(model, None, lora, weight, 0.0) 470 | return (model, ) 471 | 472 | 473 | class HyperLoRASaveLoRANode: 474 | 475 | @classmethod 476 | def INPUT_TYPES(cls): 477 | return inputs_def(required=[ 478 | str_field('filename_prefix', default='lora/id_lora'), 479 | custom_field('lora', type_name='LORA') 480 | ]) 481 | 482 | RETURN_TYPES = () 483 | FUNCTION = 'execute' 484 | CATEGORY = 'HyperLoRA' 485 | OUTPUT_NODE = True 486 | 487 | def execute(self, filename_prefix, lora): 488 | full_output_folder, filename, counter, _, _ = folder_paths.get_save_image_path( 489 | filename_prefix, folder_paths.get_output_directory()) 490 | save_file(lora, os.path.join(full_output_folder, f'{filename}_{counter:05d}_.safetensors')) 491 | return (True, ) 492 | 493 | 494 | class HyperLoRAFaceAttrNode: 495 | 496 | @classmethod 497 | def INPUT_TYPES(cls): 498 | return inputs_def(required=[ 499 | custom_field('hyper_lora', type_name='HYPER_LORA'), 500 | image_field('images') 501 | ]) 502 | 503 | RETURN_TYPES = ('FACE_ATTR', ) 504 | FUNCTION = 'execute' 505 | CATEGORY = 'HyperLoRA' 506 | 507 | def execute(self, hyper_lora: HyperLoRA, images: torch.Tensor): 508 | images = tensor2images(images) 509 | face_attrs = [] 510 | has_face = False 511 | for image in images: 512 | bgr_image = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR) 513 | for size in range(640, 128, -128): 514 | hyper_lora.face_analyzer.det_model.input_size = (size, size) 515 | faces = hyper_lora.face_analyzer.get(bgr_image) 516 | if len(faces) > 0: 517 | has_face = True 518 | break 519 | face_attr = FaceAttrResp(n_face=len(faces), w=image.width, h=image.height, faces=[]) 520 | for face in faces: 521 | face_attr.faces.append(FaceAttrInfo(rect=face.bbox, landmarks=face.landmark_2d_106)) 522 | face_attrs.append(face_attr) 523 | assert has_face, 'No face detected!' 524 | return (face_attrs, ) 525 | 526 | 527 | class HyperLoRAUniLoaderNode: 528 | 529 | @classmethod 530 | def INPUT_TYPES(cls): 531 | cls.CONFIG_NODE = HyperLoRAConfigNode() 532 | cls.LOADER_NODE = HyperLoRALoaderNode() 533 | return inputs_def(required=[ 534 | enum_field('image_processor', options=list_models('hyper_lora/clip_processor')), 535 | enum_field('image_encoder', options=list_models('hyper_lora/clip_vit')), 536 | enum_field('encoder_types', options=[ 'clip', 'arcface', 'clip + arcface' ]), 537 | enum_field('face_analyzer', options=list_models('insightface/models')), 538 | enum_field('model', options=list_models('hyper_lora/hyper_lora')), 539 | enum_field('dtype', options=[ 'fp16', 'bf16', 'fp32' ]) 540 | ]) 541 | 542 | RETURN_TYPES = ('HYPER_LORA', ) 543 | FUNCTION = 'execute' 544 | CATEGORY = 'HyperLoRA' 545 | 546 | def execute(self, image_processor, image_encoder, encoder_types, face_analyzer, model, dtype): 547 | config = HyperLoRAUniLoaderNode.CONFIG_NODE.execute(**{ 548 | 'image_processor': image_processor, 549 | 'image_encoder': image_encoder, 550 | 'resampler.dim': 1024, 551 | 'resampler.dim_head': 64, 552 | 'resampler.heads': 12, 553 | 'resampler.depth': 4, 554 | 'resampler.ff_mult': 4, 555 | 'encoder_types': encoder_types, 556 | 'face_analyzer': face_analyzer, 557 | 'id_embed_dim': 512, 558 | 'num_id_tokens': 16, 559 | 'hyper_dim': 128, 560 | 'lora_rank': 8, 561 | 'has_base_lora': False 562 | })[0] 563 | return HyperLoRAUniLoaderNode.LOADER_NODE.execute(config, model, dtype) 564 | 565 | 566 | class HyperLoRAUniGenerateIDLoRANode: 567 | 568 | @classmethod 569 | def INPUT_TYPES(cls): 570 | cls.FACE_ATTR_NODE = HyperLoRAFaceAttrNode() 571 | cls.ID_COND_NODE = HyperLoRAIDCondNode() 572 | cls.GEN_ID_LORA_NODE = HyperLoRAGenerateIDLoRANode() 573 | return inputs_def(required=[ 574 | custom_field('hyper_lora', type_name='HYPER_LORA'), 575 | image_field('images'), 576 | bool_field('grayscale', default=False), 577 | bool_field('remove_background', default=True) 578 | ]) 579 | 580 | RETURN_TYPES = ('LORA', ) 581 | FUNCTION = 'execute' 582 | CATEGORY = 'HyperLoRA' 583 | 584 | def execute(self, hyper_lora, images, grayscale, remove_background): 585 | face_attrs = HyperLoRAUniGenerateIDLoRANode.FACE_ATTR_NODE.execute(hyper_lora, images)[0] 586 | id_conds = HyperLoRAUniGenerateIDLoRANode.ID_COND_NODE.execute(hyper_lora, images, face_attrs, grayscale, remove_background)[0] 587 | return HyperLoRAUniGenerateIDLoRANode.GEN_ID_LORA_NODE.execute(hyper_lora, id_conds) 588 | 589 | 590 | HYPER_LORA_CLASS_MAPPINGS = { 591 | 'HyperLoRAConfig': HyperLoRAConfigNode, 592 | 'HyperLoRALoader': HyperLoRALoaderNode, 593 | 'HyperLoRAIDCond': HyperLoRAIDCondNode, 594 | 'HyperLoRABaseCond': HyperLoRABaseCondNode, 595 | 'HyperLoRAGenerateIDLoRA': HyperLoRAGenerateIDLoRANode, 596 | 'HyperLoRAGenerateBaseLoRA': HyperLoRAGenerateBaseLoRANode, 597 | 'HyperLoRAApplyLoRA': HyperLoRAApplyLoRANode, 598 | 'HyperLoRASaveLoRA': HyperLoRASaveLoRANode, 599 | 'HyperLoRAFaceAttr': HyperLoRAFaceAttrNode, 600 | 'HyperLoRAUniLoader': HyperLoRAUniLoaderNode, 601 | 'HyperLoRAUniGenerateIDLoRA': HyperLoRAUniGenerateIDLoRANode 602 | } 603 | 604 | HYPER_LORA_DISPLAY_NAME_MAPPINGS = { 605 | 'HyperLoRAConfig': 'HyperLoRA Config', 606 | 'HyperLoRALoader': 'HyperLoRA Loader', 607 | 'HyperLoRAIDCond': 'HyperLoRA ID Cond', 608 | 'HyperLoRABaseCond': 'HyperLoRA Base Cond', 609 | 'HyperLoRAGenerateIDLoRA': 'HyperLoRA Generate ID LoRA', 610 | 'HyperLoRAGenerateBaseLoRA': 'HyperLoRA Generate Base LoRA', 611 | 'HyperLoRAApplyLoRA': 'HyperLoRA Apply LoRA', 612 | 'HyperLoRASaveLoRA': 'HyperLoRA Save LoRA', 613 | 'HyperLoRAFaceAttr': 'HyperLoRA Face Attr', 614 | 'HyperLoRAUniLoader': 'HyperLoRA Uni Loader', 615 | 'HyperLoRAUniGenerateIDLoRA': 'HyperLoRA Uni Generate ID LoRA' 616 | } 617 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . --------------------------------------------------------------------------------