Skip to content

Instantly share code, notes, and snippets.

View 0xdevalias's full-sized avatar
👀
Open to opportunities

Glenn 'devalias' Grant 0xdevalias

👀
Open to opportunities
View GitHub Profile
diff --git a/modules/sd_hijack.py b/modules/sd_hijack.py
index eaedac1..67eac6c 100644
--- a/modules/sd_hijack.py
+++ b/modules/sd_hijack.py
@@ -4,6 +4,7 @@ import sys
import traceback
import torch
import numpy as np
+import open_clip
from torch import einsum
@Christopher-Hayes
Christopher-Hayes / convertToCheckpoint.md
Last active February 10, 2024 14:53
Convert DreamBooth .bin files to a .ckpt file

Converting DreamBooth .bin files to a .ckpt model file.

These instructions are based on DreamBooth usage with the https://github.com/ShivamShrirao/diffusers repo.

1. Add the script files

Below are 2 files. "convertToCkpt.py" and "toCkpt.sh". Create those files inside the examples/dreambooth folder with the code provided.

1a. Python convert script (required)

@harubaru
harubaru / wd1-3-release.md
Last active April 20, 2024 04:35
Official Release Notes for Waifu Diffusion 1.3
# Script for converting a HF Diffusers saved pipeline to a Stable Diffusion checkpoint.
# *Only* converts the UNet, VAE, and Text Encoder.
# Does not convert optimizer state or any other thing.
# Written by jachiam
import argparse
import os.path as osp
import torch
@mattmc3
mattmc3 / optparsing_demo.zsh
Last active April 5, 2024 21:22
Zsh option parsing example
# Manual opt parsing example
#
# Features:
# - supports short and long flags (ie: -v|--verbose)
# - supports short and long key/value options (ie: -f <file> | --filename <file>)
# - supports short and long key/value options with equals assignment (ie: -f=<file> | --filename=<file>)
# - does NOT support short option chaining (ie: -vh)
# - everything after -- is positional even if it looks like an option (ie: -f)
# - once we hit an arg that isn't an option flag, everything after that is considered positional
function optparsing_demo() {
@LitileXueZha
LitileXueZha / debug-react-source-code.md
Last active July 10, 2022 02:23
Debug react source code on yourself custom builds with source map.

Debug react source code on yourself custom builds with source map. First of all, read offical guide How to Contribute and be familiar with it's build flow.

Clone the repository, use specified branch or tag, eg: v16.8.0:

$ git clone --depth 1 --branch v16.8.0 [repo url]
$ cd ./react
$ yarn
...
AssertionError [ERR_ASSERTION]: Current node version is not supported for development

1. Plug in Ledger, open Ledger Live and update device firmware to latest

Screen Shot 2021-07-07 at 9 07 44 AM

2. Go to Settings -> Expirimental Features

Screen Shot 2021-07-07 at 9 07 51 AM

3. Enable "Developer mode"

@goran-peoski-work
goran-peoski-work / lazy.ts
Last active April 13, 2024 19:44
Dynamic import of omponent
import React, { ComponentType, LazyExoticComponent } from "react";
type Transformer = <T>(name: keyof T) => (module: T) => { default: T[keyof T] };
const transformer: Transformer = (
(name) => (module) => ({ default: module[name] })
);
@supermamon
supermamon / code.js
Last active January 3, 2024 13:01
Example Google Apps Script WebApp to read/append to a Spreadsheet
/*
How to setup
============
1. Go to https://script.google.com and login
2. Click New Project
3. Give the project a name be clicking on "Untitled Project" and giving a new name
4. Copy this whole code and overwrite everything on Code.gs file. Click on the Save icon to save.
5. Go to Google drive and open the worksheet that you want to manipulate
6. Take a look at the url. It should be in this format -- https://docs.google.com/spreadsheets/d/spreadheet-id-as-some-long-seemingly-random-characters/edit#gid=478439860
@KoryNunn
KoryNunn / handshake-airdrop.md
Last active March 12, 2024 07:03
Handshake airdrop for github users.

Had 15 github followers in 2019? You can get about $4kAUD of crypto for minimal effort.

Explain this scam

That's legitimately a good default position to hold, however, in this case, the free money is a function of time, and not only charity.

In February 2020, in order to promote Handshake (HNS) to developers, an airdrop was offered to any Github user with more than 15 followers. The Airdrop would give you 4246HNS, at the time worth around at $0.08USD per coin, for a total of $339.68USD, pretty generous!

Today, 4246HNS is worth around $4000 dollarydoos, and there are plenty of github users who haven't claimed theirs.