This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Convert PyTorch files (.bin, .pth, .pt, .ckpt) to SafeTensors format. | |
| By:marduk191 | |
| """ | |
| import os | |
| import argparse | |
| import torch | |
| from safetensors.torch import save_file, save_model |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| import torch.nn.functional as F | |
| import numpy as np | |
| from PIL import Image, ImageFilter, ImageEnhance | |
| import math | |
| import comfy.model_management as mm | |
| import comfy.utils | |
| import comfy.samplers | |
| import folder_paths |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Script to merge separated CLIP, VAE, and model safetensor files back into a single safetensor file. | |
| https://github.com/marduk191 | |
| """ | |
| import os | |
| import json | |
| import struct | |
| import torch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Safetensors deshard | |
| https://github.com/marduk191 | |
| """ | |
| import sys | |
| import os | |
| import json | |
| import struct | |
| import torch | |
| from safetensors import safe_open |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tkinter as tk | |
| from tkinter import ttk, filedialog, messagebox, scrolledtext | |
| import os | |
| import subprocess | |
| import threading | |
| from pathlib import Path | |
| import sys | |
| class ScriptRunnerGUI: | |
| def __init__(self, root): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Script to scan directory for safetensor files and extract model, clip, and vae components | |
| into separate folders using memory-efficient loading. | |
| https://github.com/marduk191 | |
| """ | |
| import os | |
| import json | |
| import struct |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| SafeTensor Model Merger with Multiple Averaging Methods | |
| Supports Simple Moving Average (SMA), Exponential Moving Average (EMA), and Weighted Moving Average (WMA) | |
| https://github.com/marduk191 | |
| """ | |
| import os | |
| import sys | |
| import json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # created by https://gist.github.com/silveroxides | |
| import torch | |
| from safetensors.torch import save_file | |
| import argparse | |
| import os | |
| def convert_pt_to_safetensors(model_path, safe_path): | |
| model = torch.load(model_path, map_location="cpu", weights_only=False) | |
| metadata = {"format":"pt"} | |
| save_file(model, safe_path, metadata) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| https://github.com/marduk191 | |
| """ | |
| import torch | |
| import gc | |
| from typing import Dict, Any, Tuple, Optional | |
| import comfy.model_management as model_management | |
| import comfy.utils | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Minimal SafeTensors Converter | |
| Converts PyTorch model files (.pt, .pth) to .safetensors format | |
| Usage: python converter.py <input_path> [output_path] | |
| by:marduk191 | |
| https://github.com/marduk191 | |
| """ | |
| import os |
NewerOlder