Skip to content

Instantly share code, notes, and snippets.

View dfl's full-sized avatar

David Löwenfels dfl

View GitHub Profile
@DarkStoorM
DarkStoorM / Subject-Oriented Inpainting.md
Last active August 27, 2024 09:49
Random document on Subject-Oriented Inpainting and Detailing in Stable Diffusion + my personal workflow.

Stable Diffusion, Subject-Oriented Inpainting

Caution

24 Aug 2024 - Please keep in mind that this document is obsolete and lots of things have changed since its release, this document is not maintained in terms of technicalities. Most things still apply as I still do things with the same workflow, except the settings at this point are a "whatever" and I use Hypertile with the recent A1111 releases (switched to 1.10), so the samplers/CFG etc. settings don't really matter unless you use things like XL Turbo or whatever people release today, use whatever is recommended. Also "enhancers" in prompts are just a meme.

Table of Contents:

@watzon
watzon / promptconvert.py
Created February 22, 2023 04:22
Stable Diffusion WebUI to InvokeAI prompt conversion script
import re
import argparse
re_attention = re.compile(r"""
\\\(|
\\\)|
\\\[|
\\]|
\\\\|
\\|
@brianjbayer
brianjbayer / gist-unlocking-the-secrets-of-rails-secrets-and-credentials.md
Last active September 6, 2024 22:02
A comprehensive examination of Rails Secrets, Credentials, and Secret Key Base

Unlocking the Secrets of Rails Secrets and Credentials

Interurban Tunnel at Blackhand Gorge- Brian J Bayer


If you are like many (most?) of us, you have encountered Rails Credentials/Secrets and secret_key_base and may have been left a bit (or more) confused.

This post is an attempt to remove some of that confusion by

@whjms
whjms / kobold-8bit.md
Last active April 7, 2023 16:35
Instructions for running KoboldAI in 8-bit mode

Running KoboldAI in 8-bit mode

tl;dr use Linux, install bitsandbytes (either globally or in KAI's conda env, add load_in_8bit=True, device_map="auto" in model pipeline creation calls)

Many people are unable to load models due to their GPU's limited VRAM. These models contain billions of parameters (model weights and biases), each of which is a 32 (or 16) bit float. Thanks to the hard work of some researchers [1], it's possible to run these models using 8-bit numbers, which halves the required amount of VRAM compared to running in half-precision. E.g. if a model requires 16GB of VRAM, running with 8-bit inference only requires 8GB.

This guide was written for KoboldAI 1.19.1, and tested with Ubuntu 20.04. These instructions are based on work by Gmin in KoboldAI's Discord server, and Huggingface's efficient LM inference guide.

Requirements

# 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
@watzon
watzon / emoji-map.json
Last active January 30, 2024 15:17
Map of emoji names to the emoji's byte sequence
{
"point_left": "\ud83d\udc48",
"mailbox_with_mail": "\ud83d\udcec",
"timer": "\u23f2",
"grinning": "\ud83d\ude00",
"yum": "\ud83d\ude0b",
"strawberry": "\ud83c\udf53",
"ice_skate": "\u26f8",
"middle_finger_tone2": "\ud83d\udd95\ud83c\udffc",
"star_and_crescent": "\u262a",
@spk
spk / deploy.yaml
Created January 7, 2020 10:36
Github Action Heroku Git Deploy
# https://github.com/marketplace/actions/checkout
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#issue-comment-event-issue_comment
# https://devcenter.heroku.com/changelog-items/775
# https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches
# https://github.com/cirrus-actions/rebase#installation
# https://github.com/actions/heroku/issues/10
---
name: Deploy to HEROKU_APP_NAME
on:
@mnishiguchi
mnishiguchi / rails_js_timezone.md
Last active February 5, 2024 17:04
Rails, JS - Time zone

Time zone considerations for a Rails app

Time zones in Rails (3 types)

1. system time

  • Our machine's time zone.
# Check our system time zone.
Time.now.getlocal.zone
@wannyk
wannyk / SVD.swift
Created October 30, 2015 08:04
MATLAB svd(x) in Swift
//
// SVD.swift
//
// Created by Dongwan Kim on 2015. 10. 30..
//
/* MATLAB svd(X)
For the matrix
@dhavaln
dhavaln / PlaySoundsViewController.swift
Last active August 29, 2019 13:42
Change Pitch Rate of Sound in Swift - XCode 6.4
var engine: AVAudioEngine!
var file: AVAudioFile!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
engine = AVAudioEngine()
audioFile = AVAudioFile(forReading: filePathUrl, error: nil)