Skip to content

Instantly share code, notes, and snippets.

View CoffeeVampir3's full-sized avatar

Z CoffeeVampir3

View GitHub Profile
import re, os, random, csv
class WildCLIP:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"text": ("STRING", {"multiline": True}), "clip": ("CLIP", )
}
}
// Fill out your copyright notice in the Description page of Project Settings.
#include "Ai/Behaviours/NecroAiBasicCombatant.h"
#include "NavigationSystem.h"
#include "NecroGameplayTags.h"
#include "AbilitySystem/NecroAbilitySystem.h"
#include "ActorInterfaces/CombatInterface.h"
#include "GameFramework/Character.h"
@CoffeeVampir3
CoffeeVampir3 / vae_preview_test.ipynb
Created February 19, 2024 21:30
vae-preview for SDXL
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CoffeeVampir3
CoffeeVampir3 / Aesthetic_interval_filter.py
Created February 14, 2024 16:04
Anti jpeg data collator
import json
def filter_images_by_score_interval(jsonl_file_path, target_interval, output_file_path):
min_score = None
matching_entries = []
# Find the minimum score in the file
with open(jsonl_file_path, 'r') as file:
for line in file:
json_object = json.loads(line)
@CoffeeVampir3
CoffeeVampir3 / moondream_tag.py
Created February 13, 2024 20:44
moondream tagger
from transformers import AutoModelForCausalLM, CodeGenTokenizerFast as Tokenizer
from moondream import Moondream
from PIL import Image
from collections import Counter
import glob
import os
model = Moondream.from_pretrained("/home/blackroot/Desktop/moond/moondream1").to("cuda")
tokenizer = Tokenizer.from_pretrained("/home/blackroot/Desktop/moond/moondream1/tokenizer")
@CoffeeVampir3
CoffeeVampir3 / style.sh
Created February 13, 2024 20:11
Kohya SDXL style run
#!/bin/bash
# Config Start
# Configurations
ckpt="checkpoint path here" # base checkpoint to finetune
image_dir="training path here, should have images as subfolder" # folder containing folders with repeats_conceptname
reg_dir="" #optional, just point this to an empty folder if you don't care
output="output path here" # safetensors output folder
import sympy as sp
import random
from functools import partial
# Define the symbol
x = sp.symbols('x')
# Rules dictionary mapping rule names to (operation, inverse operation) tuples
rules = {
'addition': (lambda f, n: f + n, lambda f, n: f - n),
@CoffeeVampir3
CoffeeVampir3 / mov2seq.py
Created February 4, 2024 05:47
video stuff
from PIL import Image
import os
import numpy as np
import sys
import cv2
def video_to_frames(video_file, output_dir, one_every_n_frames):
# Create VideoCapture object
vidcap = cv2.VideoCapture(video_file)
fps = int(vidcap.get(cv2.CAP_PROP_FPS))
using UnrealBuildTool;
public class Necromonicon : ModuleRules
{
public Necromonicon(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
CppStandard = CppStandardVersion.Latest;
CStandard = CStandardVersion.Latest;
@CoffeeVampir3
CoffeeVampir3 / query thing.cpp
Created November 27, 2023 22:20
failed attempt at succeeding
NecroAiTask UNecroAiComponent::MoveToPoint(const FVector Dest, const float AcceptanceRadius = 160.0f) const
{
auto NavSys = Cast<UNavigationSystemV1>(GetWorld()->GetNavigationSystem());
check(NavSys);
auto NavProps = FNavAgentProperties(ControlledCharacter->GetSimpleCollisionRadius(), 128.f);
NavProps.bCanWalk = true;
NavProps.bCanFly = false;
auto Query = FPathFindingQuery();
Query.NavAgentProperties = NavProps;