Skip to content

Instantly share code, notes, and snippets.

@nateraw
nateraw / stable_diffusion_walk.py
Created August 18, 2022 05:59
Walk between stable diffusion text prompts
"""
Built on top of this gist by @karpathy:
https://gist.github.com/karpathy/00103b0037c5aaea32fe1da1af553355
stable diffusion dreaming over text prompts
creates hypnotic moving videos by smoothly walking randomly through the sample space
example way to run this script:
$ python stable_diffusion_walk.py --prompts "['blueberry spaghetti', 'strawberry spaghetti']" --seeds 243,523 --name berry_good_spaghetti
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Zekfad
Zekfad / conventional-commits.md
Last active November 16, 2024 04:49
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change / feat(scope)!: rework API
  • chore(deps): update dependencies

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Changes which doesn't change source code or tests e.g. changes to the build process, auxiliary tools, libraries
@bioimage-analysis
bioimage-analysis / napari_browser.py
Last active May 30, 2020 23:34
File browser for napari
from qtpy.QtWidgets import (
QPushButton,
QComboBox,
QTabWidget,
QHBoxLayout,
QFileDialog,
QDialogButtonBox,
QWidget,
QSlider,
)
@Bomberus
Bomberus / main.py
Last active November 8, 2019 01:50
Asyncqt, concurrent executor example
import sys, asyncio, random, threading, datetime
from qtpy.QtWidgets import QApplication, QProgressBar
from asyncqt import QEventLoop, QThreadExecutor
app = QApplication(sys.argv)
loop = QEventLoop(app)
asyncio.set_event_loop(loop)
progress = QProgressBar()
@NicoKiaru
NicoKiaru / CachedBorders.groovy
Last active April 27, 2019 13:30
Lazy and cached border computation of a Label Image with BigDataViewer
/**
* GROOVY SCRIPT COMPUTING ON THE FLY EDGES OF A LABEL IMAGE
* -----
* - Computes a sample label image
* - Computes lazily with a disk cached cell img an image which finds the border of the labels in 3D
* - Displays both images in BigDataViewer
*
* Code to create the label image mainly copied from:
* - https://imagej.net/ImgLib2_Examples#Example_8_-_Working_with_sparse_data
* - And https://github.com/imglib/imglib2-cache-examples
@ksugar
ksugar / keras_weighted_binary_crossentropy.py
Last active February 9, 2019 14:27
Custom loss function for weighted binary crossentropy in Keras with Tensorflow
# code picked up from https://github.com/keras-team/keras/blob/master/keras/backend/tensorflow_backend.py
# Just used tf.nn.weighted_cross_entropy_with_logits instead of tf.nn.sigmoid_cross_entropy_with_logits with input pos_weight in calculation
import tensorflow as tf
from keras import backend as K
""" Weighted binary crossentropy between an output tensor and a target tensor.
# Arguments
pos_weight: A coefficient to use on the positive examples.
# Returns
@giswqs
giswqs / build-conda-package
Last active March 2, 2021 02:02
Building a conda package and uploading it to Anaconda Cloud
#!/bin/bash
# change the package name to the existing PyPi package you would like to build and adjust the Python versions
pkg='whitebox'
array=( 3.5 3.6 3.7 )
echo "Building conda package ..."
cd ~
conda skeleton pypi $pkg
cd $pkg