Skip to content

Instantly share code, notes, and snippets.

@kato-megumi
kato-megumi / anime4k_2_hlsl.py
Last active March 11, 2024 06:31
convert pth to hlsl
import torch
import math
import re
import argparse
import os
parser = argparse.ArgumentParser()
parser.add_argument("pth", help="Path to the input pth file")
parser.add_argument("out", help="Path to the output folder")
parser.add_argument("name", help="Name of hlsl file")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kato-megumi
kato-megumi / DigitalFlim_SUC.hlsl
Last active March 11, 2024 11:41
magpie effect
This file has been truncated, but you can view the full file.
//!MAGPIE EFFECT
//!VERSION 4
//!SORT_NAME digital_film_suc
//!TEXTURE
Texture2D INPUT;
//!TEXTURE
//!WIDTH INPUT_WIDTH * 2
import sys
import os
import re
if len(sys.argv) < 2:
print("Usage:")
print(" GenHxHashList Dump.log ...")
print()
print("Note: Support multi input file,")
print(" output will be created in the current directory.")

ChaiNNer with remote backend

Alex Dodge (@Eighty on Discord)

Last Updated: 27 Feb 2023

Introduction

This document will describe how to run chaiNNer on RunPod and connect to it with a frontend running on your local machine. This way you can take advantage of cloud GPUs.

We're not using any RunPod-specific features, so this general approach should work for any cloud service, with some modifications. This is written assuming you're running Linux. At the end, I'll put some notes about Mac and Windows, as far as I can figure it out.

@kato-megumi
kato-megumi / deband.hlsl
Created February 1, 2023 11:42
port mpv deband shader for magpie
// Deband
// Port from https://github.com/haasn/gentoo-conf/blob/xor/home/nand/.mpv/shaders/deband.glsl
//!MAGPIE EFFECT
//!VERSION 2
//!PARAMETER
//!DEFAULT 64
//!MIN 0
@kato-megumi
kato-megumi / play.py
Last active February 18, 2021 10:57
Youtube on Rasp using vlc, open by phone via termux
#!/usr/bin/python3
#~play.py
import sys,os,subprocess
os.system("killall vlc")
ps = subprocess.run(["pgrep", "play.py"], stdout=subprocess.PIPE).stdout.decode('utf-8').split('\n')[:-2]
for p in ps:
os.system("kill -9 "+p)
if (len(sys.argv)==1): exit()
if 'list' in sys.argv[1]:
ids = subprocess.run(['youtube-dl', '--flat-playlist','--get-id',sys.argv[1]], stdout=subprocess.PIPE).stdout.decode('utf-8').split('\n')[:-1]
@kato-megumi
kato-megumi / scapy_bridge.py
Created March 23, 2020 13:38 — forked from eXenon/scapy_bridge.py
Use scapy as a modifying proxy
#!/usr/bin/python2
"""
Use scapy to modify packets going through your machine.
Based on nfqueue to block packets in the kernel and pass them to scapy for validation
"""
import nfqueue
from scapy.all import *
import os
import networkx as nx
import numpy as np
from operator import attrgetter
cal_times = 0
def readfile(name): #test/10a280.clt
global v_n,c_n,vs,cs
with open(name) as f:
import networkx as nx
import numpy as np
from operator import attrgetter
cal_times = 0
def readfile(name): #test/10a280.clt