Skip to content

Instantly share code, notes, and snippets.

View doctorpangloss's full-sized avatar

Benjamin Berman doctorpangloss

View GitHub Profile
@doctorpangloss
doctorpangloss / wan_22_14b.json
Last active November 8, 2025 06:08
wan_22_14b
{
"60": {
"inputs": {
"filename_prefix": "Qwen_t2i",
"images": [
"75:8",
0
]
},
"class_type": "SaveImage",
@doctorpangloss
doctorpangloss / hello.json
Created August 15, 2025 16:55
json example
{
"1": {
"inputs": {
"value": [
"2",
0
]
},
"class_type": "PreviewString",
"_meta": {
@doctorpangloss
doctorpangloss / script.sh
Last active July 24, 2025 19:19
build upnpc into a static binary
`#!/bin/bash
# This script creates a Dockerfile in the current directory using a heredoc,
# then builds a Docker image to compile a static 'upnpc' binary from the official Git repository,
# and finally exports the binary to a local './output' directory.
# Create the Dockerfile using a heredoc
cat <<EOF > Dockerfile
FROM debian:bookworm AS builder
@doctorpangloss
doctorpangloss / example.md
Last active February 4, 2025 00:38
distributed comfyui example

Below is a succinct guide showing how to set up:

  1. A uv‑backed virtual environment on Linux
  2. A Docker build for ComfyUI
  3. RabbitMQ with a KEDA ScaledObject for auto-scaling workers
  4. A ComfyUI frontend Deployment and ComfyUI worker StatefulSet

…plus a short Python script using the “queue_and_forget” approach.


@doctorpangloss
doctorpangloss / install.sh
Last active November 25, 2024 17:56
Installing ComfyUI on macOS
# install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# install python 3.12
brew install python@3.12
# link it
brew link python@3.12
# check that you have python installed and that it's python 3.12
python3 --version
# install UV to get everything working faster
curl -LsSf https://astral.sh/uv/install.sh | sh
@doctorpangloss
doctorpangloss / install_caffe.sh
Last active October 16, 2024 14:28
Installing Caffe on Mac 10.11.5 and later in the 10.11 series, and 10.12.1 and later in the 10.12 series
#!/bin/sh
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Apple hides old versions of stuff at https://developer.apple.com/download/more/
# Install the latest XCode (8.0).
# We used to install the XCode Command Line Tools 7.3 here, but that would just upset the most recent versions of brew.
# So we're going to install all our brew dependencies first, and then downgrade the tools. You can switch back after
# you have installed caffe.
# Install CUDA toolkit 8.0 release candidate
# Register and download from https://developer.nvidia.com/cuda-release-candidate-download
import math
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.transforms as TT
from PIL import Image
from einops import rearrange
from einops.layers.torch import Rearrange
@doctorpangloss
doctorpangloss / repetition_algorithm.ipynb
Last active November 23, 2023 19:13
Supermemo 2 Algorithm, Unobscured (Python 3)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@doctorpangloss
doctorpangloss / containerd-1.7.2.yaml
Created June 22, 2023 22:59
upgrades containerd on windows for GKE
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: containerd-upgrade
namespace: kube-system
spec:
selector:
matchLabels:
name: containerd-upgrade
template:
@doctorpangloss
doctorpangloss / GrpcExtensions.cs
Created October 7, 2021 16:46
Improving semantics around gRPC on Unity
using System;
using System.Collections.Generic;
using Grpc.Core;
using UniRx;
using UniRx.Diagnostics;
using UnityEngine;
using System;
using System.Collections.Concurrent;
using System.Threading;
using Cysharp.Threading.Tasks;