Skip to content

Instantly share code, notes, and snippets.

View jochemstoel's full-sized avatar
💭
Dematerializing

Jochem Stoel jochemstoel

💭
Dematerializing
View GitHub Profile
@jochemstoel
jochemstoel / ChatGPT Stable Diffusion prompts generator.txt
Created November 21, 2023 00:44 — forked from bluelovers/ChatGPT Stable Diffusion prompts generator.txt
using ChatGPT as Stable Diffusion prompts generator
Stable Diffusion is an AI art generation model similar to DALLE-2.
Here are some prompts for generating art with Stable Diffusion.
Example:
- A ghostly apparition drifting through a haunted mansion's grand ballroom, illuminated by flickering candlelight. Eerie, ethereal, moody lighting.
- portait of a homer simpson archer shooting arrow at forest monster, front game card, drark, marvel comics, dark, smooth
- pirate, deep focus, fantasy, matte, sharp focus
- red dead redemption 2, cinematic view, epic sky, detailed, low angle, high detail, warm lighting, volumetric, godrays, vivid, beautiful
- a fantasy style portrait painting of rachel lane / alison brie hybrid in the style of francois boucher oil painting, rpg portrait
@jochemstoel
jochemstoel / native jQuery methods.js
Last active November 9, 2023 15:53
Vanilla implementations of commonly used jQuery methods.
/**
* Convenient shortcut
*/
Object.defineProperty(window, 'define', {
value: (property, ...meta) => meta.length == 2 ? Object.defineProperty(meta[0], property, meta[1]) : Object.defineProperty(window, property, meta[0]),
writable: false,
enumerable: true
})
@jochemstoel
jochemstoel / split_silence.sh
Created December 26, 2017 11:24 — forked from VojtechKlos/split_silence.sh
Guide to split audio recording by silence with SoX and ffmpeg
# First denoise audio
## Get noise sample
ffmpeg -i input.ogg -vn -ss 00:00:00 -t 00:00:01 noise-sample.wav
## Create noise profile
sox noise-sample.wav -n noiseprof noise.prof
## Clean audio from noise
sox input.ogg clean.wav noisered noise.prof 0.21
@jochemstoel
jochemstoel / FontAwesome-v5.0.9-Free.json
Created March 13, 2023 06:12 — forked from sakalauskas/FontAwesome-v5.0.9-Free.json
List of all Font Awesome 5 icons in JSON Cheetsheet
{
"fas fa-address-book","fas fa-address-card","fas fa-adjust","fas fa-align-center","fas fa-align-justify","fas fa-align-left","fas fa-align-right","fas fa-allergies","fas fa-ambulance","fas fa-american-sign-language-interpreting","fas fa-anchor","fas fa-angle-double-down","fas fa-angle-double-left","fas fa-angle-double-right","fas fa-angle-double-up","fas fa-angle-down","fas fa-angle-left","fas fa-angle-right","fas fa-angle-up","fas fa-archive","fas fa-arrow-alt-circle-down","fas fa-arrow-alt-circle-left","fas fa-arrow-alt-circle-right","fas fa-arrow-alt-circle-up","fas fa-arrow-circle-down","fas fa-arrow-circle-left","fas fa-arrow-circle-right","fas fa-arrow-circle-up","fas fa-arrow-down","fas fa-arrow-left","fas fa-arrow-right","fas fa-arrow-up","fas fa-arrows-alt","fas fa-arrows-alt-h","fas fa-arrows-alt-v","fas fa-assistive-listening-systems","fas fa-asterisk","fas fa-at","fas fa-audio-description","fas fa-backward","fas fa-balance-scale","fas fa-ban","fas fa-band-aid","fas fa-barcode","fas fa-bars",
@jochemstoel
jochemstoel / dreambooth_stable_diffusion_mod.ipynb
Created February 1, 2023 23:22 — forked from inu-ai/dreambooth_stable_diffusion_mod.ipynb
dreambooth_stable_diffusion_mod.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import os
import torch
from torch import autocast
from diffusers import StableDiffusionPipeline, DDIMScheduler
model_path = os.getenv('WEIGHTS_DIR')
scheduler = DDIMScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear", clip_sample=False, set_alpha_to_one=False)
pipe = StableDiffusionPipeline.from_pretrained(model_path, scheduler=scheduler, safety_checker=None, torch_dtype=torch.float16).to("cuda")
@jochemstoel
jochemstoel / setup_StableDiffusionPipeline.py
Created February 1, 2023 20:32 — forked from victormurcia/setup_StableDiffusionPipeline.py
code to setup Stable Diffusion pipeline
import mediapy as media
import torch
from diffusers import StableDiffusionPipeline
device = "cuda"
if model_id.startswith("stabilityai/"):
model_revision = "fp16"
else:
model_revision = None
@jochemstoel
jochemstoel / mounting_hf_model.py
Created February 1, 2023 20:29 — forked from luiscape/mounting_hf_model.py
`modal.Mount` a HuggingFace model
import io
import time
import modal
import os
import torch
import diffusers
from pathlib import Path
stub = modal.Stub("local-model-mount-test")
@jochemstoel
jochemstoel / Setting_upa_new_repo.md
Created December 30, 2022 22:50 — forked from alexpchin/Setting_upa_new_repo.md
Create a new repository on the command line

Setting up a new Git Repo

##Create a new repository on the command line

touch README.md
git init
git add README.md
git commit -m "first commit"

git remote add origin git@github.com:alexpchin/.git

@jochemstoel
jochemstoel / convertToJPG
Created November 21, 2022 13:43 — forked from mikey0000/convertToJPG
convert png to jpeg using javascript and write back to original file
function convertDataURIToBinary(dataURI) {
var BASE64_MARKER = ';base64,';
var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length;
var base64 = dataURI.substring(base64Index);
var raw = window.atob(base64);
var rawLength = raw.length;
var array = new Uint8Array(new ArrayBuffer(rawLength));
for (i = 0; i < rawLength; i++) {
array[i] = raw.charCodeAt(i);