Skip to content

Instantly share code, notes, and snippets.

View miabrahams's full-sized avatar

Michael Abrahams miabrahams

View GitHub Profile
@miabrahams
miabrahams / convert_safetensors_to_diffusers.ipynb
Created August 19, 2023 21:35
Jupyter notebook to convert .safetensors to diffusers
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@miabrahams
miabrahams / SDTags.ps1
Created December 1, 2022 14:41
Powershell script for Stable Diffusion image tags
function Out-SDTags($file) {
<#
Print out embedded Stable Diffusion prompt. Requires ImageMagick.
#>
$imagedata = magick convert $file json: | ConvertFrom-Json
# Pretty print to view in console
Out-Host -InputObject $imagedata.image.properties
# Raw strings to copy/paste.
# Tags are either found in "Comment/Description" fields or "Properties" field.
Write-Host $imagedata.image.properties.Comment
@miabrahams
miabrahams / mocap_tools.py
Created April 16, 2021 14:30
Mocap tools with namespace support
import os
import pymel.core as pm
import mgear.core.attribute as att
import mgear.core.transform as tra
import mgear.shifter.component as comp
from mgear.core.anim_utils import getNamespace
# All FK joints used to align the skeleton
@miabrahams
miabrahams / pip-update.ps1
Created November 18, 2020 19:01
Update all python packages with powershell
pip freeze | foreach-object {pip install -U ($_ -split "==")[0]}
@miabrahams
miabrahams / 3jnt_nested_ik.py
Created October 4, 2020 00:19
Solve positions for nested IK joint system
import pymel.core as pm
from mgear.core.transform import getChainTransform2
# See https://twitter.com/morganloomis_/status/1307263399210840065?s=20
# Pick joint chains
jnts = [pm.PyNode("jnt" + str(i)) for i in range(4)]
helperJnts = [pm.PyNode("helperJnt" + str(i)) for i in range(3)]
# Read world space xforms and positions
@miabrahams
miabrahams / ToggleTouchKeyboard.ahk
Created August 6, 2018 23:26
Autohotkey touch keyboard toggle for Windows 10
; Autohotkey script to toggle Windows 10 touch keyboard.
ToggleTouchKeyboard()
{
; Translated to AHK from https://stackoverflow.com/a/39385492
Shell_TrayWnd := FindWindowEx( 0, 0, "Shell_TrayWnd")
TrayNotifyWnd := FindWindowEx( Shell_TrayWnd, 0, "TrayNotifyWnd")
TIPBand := FindWindowEx( TrayNotifyWnd, 0, "TIPBand")
if (!TIPBand or ErrorLevel)
@miabrahams
miabrahams / FfmpegPostprocess.py
Last active March 2, 2024 18:07
Ffmpeg post-processing OBS Plugin
import obspython as obs
import subprocess
import os
import re
import datetime
# Info for potential OBS Python hackers!
# Tip 1 - Read the "OBS Studio Backend Design" documentation page. Read the documentation table of contents.
# Tip 2 - be sure to add obspython.py to your script path to enable completion.
# Tip 3 - Some of the Python API is generated at runtime, so it won't show up in obspython.py.
@miabrahams
miabrahams / gist:a40481e4abfd39d97c2e
Created October 22, 2015 16:54
Build experimental XCB library on Debian/Ubuntu
sudo apt-get install devscripts
sudo apt-get build-dep libxcb
apt-get source libxcb
in configure.ac, modify XCB_EXTENSION(XInput, "no") to "yes"
./configure --prefix=/usr
Tweak xcb-xinput.pc to prefix=/usr
sudo make install -j8
@miabrahams
miabrahams / gist:fbd1ce98276c1bb3dd44
Last active May 6, 2018 16:22
Build Wacom control panel on Debian/Ubuntu
PART 1: Install a boatload of dependencies
sudo apt-get install extra-cmake-modules qtbase5-dev libqt5x11extras5-dev qtdeclarative5-dev libkf5coreaddons-dev libkf5i18n-dev libkf5globalaccel-dev libkf5config-dev libkf5xmlgui-dev libkf5widgetsaddons-dev libkf5windowsystem-dev libkf5notifications-dev libkf5dbusaddons-dev plasma-framework-dev kdoctools-dev libx11-dev
PART 2: Build and install the Wacom control panel
git clone git://anongit.kde.org/wacomtablet
cd wacomtablet
mkdir build
;;; phabricator.el --- Phabricator/Arcanist helpers for Emacs.
;; Author: Andrew Tulloch
;; URL: https://github.com/ajtulloch/phabricator.el
;; Version: 0.1
;; Created: 2014-09-11
;; Keywords: phabricator, arcanist, diffusion
;; Package-Requires: ((emacs "24.1") (ido "0.1") (projectile "0.1") (dash "0.1"))
;; This file is NOT part of GNU Emacs.