This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import stable_inference | |
import torch | |
from einops import repeat | |
def image_grid(imgs, rows, cols): | |
assert len(imgs) == rows*cols | |
w, h = imgs[0].size | |
grid = Image.new('RGB', size=(cols*w, rows*h)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns a promise that has a cancelled method that will cause the callbacks not to fire when it resolves or rejects | |
* @param promise to wrap | |
* @returns new promise that will only resolve or reject if cancel is not called | |
*/ | |
export default function cancellable(promise) { | |
var cancelled = false; | |
const toReturn = new Promise((resolve, reject) => { | |
promise.then(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vim: expandtab ts=4 sw=4: | |
// Please compile using 'gulp', and 'gulp-typescript' | |
// This is the core of this library. | |
/************************* | |
Copyright (c) 2016 Zhongzhi Yu | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import colorsys | |
from colorz import colorz | |
WALLPAPER = '/home/james/.wallpaper' | |
COLORS = '/home/james/.colors' | |
XRESOURCES = '/home/james/.Xresources' | |
cols = '' | |
xres = """ |