Dataset Viewer
Auto-converted to Parquet Duplicate
text
stringlengths
0
1.28M
import os import importlib.util from comfy.cli_args import args import subprocess def get_gpu_names(): if os.name == 'nt': import ctypes class DISPLAY_DEVICEA(ctypes.Structure): _fields_ = [ ('cb', ctypes.c_ulong), ('DeviceName', ctypes.c_char * 32), ('DeviceString', ctypes.c_char * 128), ('StateFlags', ctypes.c_ulong)...
import sys import copy import logging import threading import heapq import traceback import inspect from typing import List, Literal, NamedTuple, Optional import torch import nodes import comfy.model_management def get_input_data(inputs, class_def, unique_id, outputs={}, prompt={}, extra_data={}): valid_inputs = class_...
import os import time import logging supported_pt_extensions = set(['.ckpt', '.pt', '.bin', '.pth', '.safetensors', '.pkl']) folder_names_and_paths = {} base_path = os.path.dirname(os.path.realpath(__file__)) models_dir = os.path.join(base_path, "models") folder_names_and_paths["checkpoints"] = ([os.path.join(models_di...
import torch from PIL import Image import struct import numpy as np from comfy.cli_args import args, LatentPreviewMethod from comfy.taesd.taesd import TAESD import comfy.model_management import folder_paths import comfy.utils import logging MAX_PREVIEW_RESOLUTION = 512 def preview_to_image(latent_image): latents_ubyte ...
import comfy.options comfy.options.enable_args_parsing() import os import importlib.util import folder_paths import time def execute_prestartup_script(): def execute_script(script_path): module_name = os.path.splitext(script_path)[0] try: spec = importlib.util.spec_from_file_location(module_name, script_path) module = ...
import os import shutil base_path = os.path.dirname(os.path.realpath(__file__)) def update_windows_updater(): top_path = os.path.dirname(base_path) updater_path = os.path.join(base_path, ".ci/update_windows/update.py") bat_path = os.path.join(base_path, ".ci/update_windows/update_comfyui.bat") dest_updater_path = os.pa...
import torch import os import sys import json import hashlib import traceback import math import time import random import logging from PIL import Image, ImageOps, ImageSequence, ImageFile from PIL.PngImagePlugin import PngInfo import numpy as np import safetensors.torch sys.path.insert(0, os.path.join(os.path.dirname(...
from PIL import ImageFile, UnidentifiedImageError def conditioning_set_values(conditioning, values={}): c = [] for t in conditioning: n = [t[0], t[1].copy()] for k in values: n[1][k] = values[k] c.append(n) return c def pillow(fn, arg): prev_value = None try: x = fn(arg) except (OSError, UnidentifiedImageError, ValueEr...
ComfyUI ======= The most powerful and modular stable diffusion GUI and backend. ----------- ![ComfyUI Screenshot](comfyui_screenshot.png) This ui will let you design and execute advanced stable diffusion pipelines using a graph/nodes/flowchart based interface. For some workflow examples and see what ComfyUI can do you ...
import os import sys import asyncio import traceback import nodes import folder_paths import execution import uuid import urllib import json import glob import struct import ssl from PIL import Image, ImageOps from PIL.PngImagePlugin import PngInfo from io import BytesIO import aiohttp from aiohttp import web import lo...
import pygit2 from datetime import datetime import sys import os import shutil import filecmp def pull(repo, remote_name='origin', branch='master'): for remote in repo.remotes: if remote.name == remote_name: remote.fetch() remote_master_id = repo.lookup_reference('refs/remotes/origin/%s' % (branch)).target merge_result...
name: Tests CI on: [push, pull_request] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: 18 - uses: actions/setup-python@v4 with: python-version: '3.10' - name: Install requirements run: | python -m pip install --upgrade pip pip install torch torchv...
import os import json from aiohttp import web class AppSettings(): def __init__(self, user_manager): self.user_manager = user_manager def get_settings(self, request): file = self.user_manager.get_request_user_filepath( request, "comfy.settings.json") if os.path.isfile(file): with open(file) as f: return json.load(f) el...
import json import os import re import uuid from aiohttp import web from comfy.cli_args import args from folder_paths import user_directory from .app_settings import AppSettings default_user = "default" users_file = os.path.join(user_directory, "users.json") class UserManager(): def __init__(self): global user_director...
import pickle load = pickle.load class Empty: pass class Unpickler(pickle.Unpickler): def find_class(self, module, name): if module.startswith("pytorch_lightning"): return Empty return super().find_class(module, name)
{ "architectures": [ "CLIPTextModel" ], "attention_dropout": 0.0, "bos_token_id": 0, "dropout": 0.0, "eos_token_id": 2, "hidden_act": "gelu", "hidden_size": 1280, "initializer_factor": 1.0, "initializer_range": 0.02, "intermediate_size": 5120, "layer_norm_eps": 1e-05, "max_position_embeddings": 77, "model_type": "clip_...
import torch from comfy.ldm.modules.attention import optimized_attention_for_device class CLIPAttention(torch.nn.Module): def __init__(self, embed_dim, heads, dtype, device, operations): super().__init__() self.heads = heads self.q_proj = operations.Linear(embed_dim, embed_dim, bias=True, dtype=dtype, device=device) se...
from .utils import load_torch_file, transformers_convert, state_dict_prefix_replace import os import torch import json import logging import comfy.ops import comfy.model_patcher import comfy.model_management import comfy.utils import comfy.clip_model class Output: def __getitem__(self, key): return getattr(self, key) d...
{ "attention_dropout": 0.0, "dropout": 0.0, "hidden_act": "gelu", "hidden_size": 1664, "image_size": 224, "initializer_factor": 1.0, "initializer_range": 0.02, "intermediate_size": 8192, "layer_norm_eps": 1e-05, "model_type": "clip_vision_model", "num_attention_heads": 16, "num_channels": 3, "num_hidden_layers": 48, "p...
{ "attention_dropout": 0.0, "dropout": 0.0, "hidden_act": "gelu", "hidden_size": 1280, "image_size": 224, "initializer_factor": 1.0, "initializer_range": 0.02, "intermediate_size": 5120, "layer_norm_eps": 1e-05, "model_type": "clip_vision_model", "num_attention_heads": 16, "num_channels": 3, "num_hidden_layers": 32, "p...
{ "attention_dropout": 0.0, "dropout": 0.0, "hidden_act": "quick_gelu", "hidden_size": 1024, "image_size": 224, "initializer_factor": 1.0, "initializer_range": 0.02, "intermediate_size": 4096, "layer_norm_eps": 1e-05, "model_type": "clip_vision_model", "num_attention_heads": 16, "num_channels": 3, "num_hidden_layers": ...
import argparse import enum import comfy.options class EnumAction(argparse.Action): """ Argparse action for handling Enums """ def __init__(self, **kwargs): enum_type = kwargs.pop("type", None) if enum_type is None: raise ValueError("type must be assigned an Enum when using EnumAction") if not issubclass(enum_type, enu...
import torch import math import comfy.utils def lcm(a, b): return abs(a*b) class CONDRegular: def __init__(self, cond): self.cond = cond def _copy_with(self, cond): return self.__class__(cond) def process_cond(self, batch_size, device, **kwargs): return self._copy_with(comfy.utils.repeat_to_batch_size(self.cond, batch_...
import torch import math import os import logging import comfy.utils import comfy.model_management import comfy.model_detection import comfy.model_patcher import comfy.ops import comfy.cldm.cldm import comfy.t2i_adapter.adapter import comfy.ldm.cascade.controlnet def broadcast_image_to(tensor, target_batch_size, batche...
import re import torch import logging unet_conversion_map = [ ("time_embed.0.weight", "time_embedding.linear_1.weight"), ("time_embed.0.bias", "time_embedding.linear_1.bias"), ("time_embed.2.weight", "time_embedding.linear_2.weight"), ("time_embed.2.bias", "time_embedding.linear_2.bias"), ("input_blocks.0.0.weight", "c...
import os import comfy.sd def first_file(path, filenames): for f in filenames: p = os.path.join(path, f) if os.path.exists(p): return p return None def load_diffusers(model_path, output_vae=True, output_clip=True, embedding_directory=None): diffusion_model_names = ["diffusion_pytorch_model.fp16.safetensors", "diffusion...
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
4