Skip to content

Instantly share code, notes, and snippets.

View SLAPaper's full-sized avatar
🤣
lmao

SLAPaper Pang SLAPaper

🤣
lmao
View GitHub Profile
@kohya-ss
kohya-ss / mem_eff_safeopen.py
Last active September 13, 2025 06:23
メインメモリを消費しないsafetensorsファイル読み込み・保存
# License: Apache 2.0
from typing import Dict, Optional
import struct
import json
import numpy as np
import torch
@kohya-ss
kohya-ss / forward_of_sdxl_original_unet.py
Created November 14, 2023 03:39
SDXLで高解像度での構図の破綻を軽減する
def forward(self, x, timesteps=None, context=None, y=None, **kwargs):
# broadcast timesteps to batch dimension
timesteps = timesteps.expand(x.shape[0])
hs = []
t_emb = get_timestep_embedding(timesteps, self.model_channels) # , repeat_only=False)
t_emb = t_emb.to(x.dtype)
emb = self.time_embed(t_emb)
assert x.shape[0] == y.shape[0], f"batch size mismatch: {x.shape[0]} != {y.shape[0]}"
@jaretburkett
jaretburkett / person-terms
Created June 27, 2023 02:30
Terms for tagging pictures of humans
aboriginal
above average
abstract composition
abusive
accessories
accountant
acid wash
acne-prone skin
acne scars
@jaretburkett
jaretburkett / Humans v1 - Token Counts
Created June 27, 2023 02:28
Humans v1 - Token Counts
This file has been truncated, but you can view the full file.
smiling mouth revealing white straight teeth - 24426
anxious expression with biting lower lip - 17012
shallow depth of field - 16806
early childhood age - 14067
social worker - 12566
smiling mouth revealing slightly crooked teeth - 12329
broad grin revealing straight white teeth - 11336
pediatrician - 11212
preschooler age - 10873
{
"⤡": "⤡",
"⊞": "⊞",
"×": "×",
"❮": "❮",
"❯": "❯",
"Loading...": "加载中...",
"Waiting...": "等待中...",
"In queue...": "队列中...",
"@@/^Waiting (.*)$/": "等待中 $1",
@swerder
swerder / FileUploadRequestHandler.py
Last active November 18, 2024 00:26 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python3
"""HTTP Server with auth and Upload.
This module builds on SimpleHTTPRequestHandler,
implements simple Authentication, use ssl
full "multipart" rfc2046 handling,
multi file upload, create folder and delete files,
TableView file listing with icon/size/date
from bones7456: https://github.com/bones7456/bones7456/blob/master/SimpleHTTPServerWithUpload.py / https://gist.github.com/UniIsland/3346170
@erkanyildiz
erkanyildiz / EYDigitalCamouflageImage.h
Last active June 7, 2017 18:26
Simple UIImage with digital camouflage patterns (Woodland, Snow, Desert, Naval, Savanna, Airborne, Ocean, Arid)
// erkanyildiz
// 20160620-1913
//
// EYDigitalCamouflageImage.h
#import <UIKit/UIKit.h>
typedef enum:NSInteger
{
EYDCIWoodland,
@touilleMan
touilleMan / SimpleHTTPServerWithUpload.py
Last active October 28, 2025 18:34 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@staltz
staltz / introrx.md
Last active October 26, 2025 03:06
The introduction to Reactive Programming you've been missing

基于 Node.js 和 Express.js 的 RESTful API 服务端开发

开发环境

  • Node.js (0.10.28+)
    • Arch Linux: 直接使用包管理器安装
    • Ubuntu / Debian / etc: 使用 visionmedia/n
    • OS X / Windows: 使用官方提供的安装包
  • 编辑器
  • WebStorm