Skip to content

Instantly share code, notes, and snippets.

@AmericanPresidentJimmyCarter
AmericanPresidentJimmyCarter / flux_lora_cfg.py
Created August 10, 2024 19:30
Use your flux-dev LoRA with a quantized model and CFG in <16gb VRAM
import inspect
from typing import Any, Callable, Dict, List, Optional, Union
import numpy as np
import torch
from transformers import CLIPTextModel, CLIPTokenizer, T5EncoderModel, T5TokenizerFast
from diffusers.image_processor import VaeImageProcessor
from diffusers.loaders import FluxLoraLoaderMixin
from diffusers.models.autoencoders import AutoencoderKL
@jedda
jedda / ACME-MDA-Example.mobileconfig
Last active January 9, 2024 06:20
An example of an ACME Certificate Profile & payload (com.apple.security.acme) that can be used on iOS (16 and above) and macOS (14 and above) to request an ACME certificate with Managed Device Attestation from Apple.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>Attest</key>
<true/>
<!--
@padeoe
padeoe / README_hfd.md
Last active December 26, 2024 07:52
CLI-Tool for download Huggingface models and datasets with aria2/wget: hfd

🤗Huggingface Model Downloader

Update(2024-12-17): 🎉 This version supports quick startup and fast recovery, automatically skipping downloaded files for efficient handling of large repos. The removal of git clone dependency further accelerates file list retrieval.

Considering the lack of multi-threaded download support in the official huggingface-cli, and the inadequate error handling in hf_transfer, This command-line tool leverages curl and aria2c for fast and robust downloading of models and datasets.

Features

  • ⏯️ Resume from breakpoint: You can re-run it or Ctrl+C anytime.
  • 🚀 Multi-threaded Download: Utilize multiple threads to speed up the download process.
  • 🚫 File Exclusion: Use --exclude or --include to skip or specify files, save time for models with duplicate formats (e.g., *.bin or *.safetensors).
  • 🔐 **Auth Supp
@danielcshn
danielcshn / fix-duplicate-class-android-studio.md
Created April 16, 2023 04:08
Fix Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules kotlin-stdlib-* Android Studio | 2022.2.1

📜 Info:

  • Android Studio Flamingo | 2022.2.1
  • Build #AI-222.4459.24.2221.9862592, built on March 31, 2023
  • Gradle JDK: jbr-17 (JetBrains Runtime version 17.0.6)
  • Windows 11 (version 10.0.22000.1817)

🐛 Bug/Error log:

from PIL import Image
import stable_inference
import numpy as np
from einops import repeat
# Interpolate video between two conditionings
FOLDER = 'test/painting'
MAX_STRENGTH = 0.5 # Strength at maximum in the middle of the interpolation
SEED = 9001
SECONDS = 10
from PIL import Image
import stable_inference
import torch
from einops import repeat
def image_grid(imgs, rows, cols):
assert len(imgs) == rows*cols
w, h = imgs[0].size
grid = Image.new('RGB', size=(cols*w, rows*h))
@Tmn07
Tmn07 / ffmpeg_2.md
Created January 23, 2022 14:12
ffmpeg命令的一些应用记录

虽然距离第一次总结ffmpeg指令与剪辑视频相关的姿势 (github.com)已经过去了三年,但是依旧是非常业余的水平。仅作个人记录,谨慎参考,表述有问题的地方欢迎讨论指正。

视频剪切

需求是尽可能无损剪切,精确时间。

根据视频关键帧的情况,分两种方案

  1. 极速方案,无损截取出视频两个关键帧之间的片段。
@hihanley
hihanley / demo.java
Created January 18, 2022 19:30
Java retrofit2 请求设置代理
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Proxy;
import lombok.Data;
import okhttp3.OkHttpClient;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.jackson.JacksonConverterFactory;
import retrofit2.http.GET;
@thomaspoignant
thomaspoignant / Makefile
Last active November 3, 2024 18:20
My ultimate Makefile for Golang Projects
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=example
VERSION?=0.0.0
SERVICE_PORT?=3000
DOCKER_REGISTRY?= #if set it should finished by /
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true
GREEN := $(shell tput -Txterm setaf 2)