Skip to content

Instantly share code, notes, and snippets.

View crosstyan's full-sized avatar

Crosstyan crosstyan

View GitHub Profile
@crosstyan
crosstyan / iter.c
Last active September 4, 2022 13:51
an example to use iterator instead of ugly fuck i. See also https://crypto.stanford.edu/~blynn/c/cruft.html
#include <stdio.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#define REP(x, n) for (int x = 0; x < n; x++)
#define REP1(x, n) for (int x = 1; x <= n; x++)
#define NELEM(a) (sizeof(a)/sizeof(a[0]))
struct test_t {
#! /usr/bin/env python
from turtle import circle
import cv2
import sys
import numpy as np
import typing
from typing import Tuple
import collections
# See also
@crosstyan
crosstyan / how_to_v2.pt.txt
Created October 10, 2022 01:43
source from discord SD Training Labs.
modules\prompt_parser.py file.
v2.pt can be loaded by putting it in the main folder of the repo and adding
---------------------------------------------------------------------------
import torch
from torch import nn
from modules import devices
class VectorAdjustPrior(nn.Module):
重要
重要
重要
重要
重要
重要
loli ojousama with red eyes, green blue gradient hair, double bun, wearing dark blue frilled dress, detached sleeves, juliet sleeves, blue butterflies, scenery.
>拝み倒すけどどういう呪文でそれを出力してるのですか…
何度かスレに貼ってるけど今はこれ
loli ojousama with red eyes, green blue gradient hair with double bun, thick bangs, dark blue frilled off the shoulder dress, detached sleeves,
from pathlib import Path
import glob
import os
# from PIL import Image
from wand.image import Image
from wand.color import Color
import shutil
import argparse
from pprint import pprint
from tqdm import tqdm
@crosstyan
crosstyan / config.yaml
Created November 20, 2022 00:23
a default config yaml of certain model
model:
base_learning_rate: 1.0e-04
target: ldm.models.diffusion.ddpm.LatentDiffusion
params:
linear_start: 0.00085
linear_end: 0.0120
num_timesteps_cond: 1
log_every_t: 200
timesteps: 1000
first_stage_key: "jpg"
@crosstyan
crosstyan / RunPy.nvjs
Last active November 26, 2022 16:26
moving file and its txt to certain dir
// @name Run Python
// @description Run Python with it
const currentPath = nv.Book.ViewPages[0].Path
/// the path of python interpreter
const pythonPath = String.raw`C:\Users\cross\AppData\Local\Programs\Python\Python310\python.exe`
/// the path of python script
const pythonScriptPath = String.raw`C:\Users\cross\Documents\NeeLaboratory\NeeView\Scripts\test.py`
const startInfo = new System.Diagnostics.ProcessStartInfo()
@crosstyan
crosstyan / get_yuri.py
Last active November 26, 2022 16:26
get yuri
import os
import glob
import shutil
from pathlib import Path
from tqdm import tqdm
from tqdm.contrib.concurrent import process_map
from psutil import cpu_count
pwd = Path(os.path.dirname(os.path.realpath(__file__)))
src_dir = pwd / 'pixiv_top50_fin'
@crosstyan
crosstyan / Dockerfile
Last active December 21, 2022 07:23
fxxk Nvidia
# https://stackoverflow.com/questions/72179923/docker-run-without-entry-point
FROM nvidia/cuda:11.6.2-devel-ubuntu20.04
ENV TZ=Asia/Shanghai
ENV DEBIAN_FRONTEND=noninteractive
RUN echo "export LANG=C.UTF-8" >>/etc/profile \
&& apt-get update \
&& apt-get install vim openssh-server iputils-ping wget curl -y \
&& sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config \
&& echo "root:114514" | chpasswd
RUN apt install -y git tmux build-essential \