Skip to content

Instantly share code, notes, and snippets.

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))
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
@16892434
16892434 / flux_lora_cfg.py
Created November 19, 2024 23:19 — forked from AmericanPresidentJimmyCarter/flux_lora_cfg.py
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
@16892434
16892434 / gist:11aad7c3b18fb4ceea2fd893c393612a
Last active October 6, 2024 13:34 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@16892434
16892434 / readme.md
Created October 4, 2024 13:38 — forked from h1code2/readme.md
整理一些常见的app跳转scheme url #小红书 #微信 #快手 #抖音

今天整理脚本时,发现存了挺多跳转app的代码,大部分是我在百度上搜索得来的,所以你们也不用问我获取方法了,用就完了。当然之前我也写过一个快手的提取scheme url的方法,想学的话在我公众号(3分钟学堂)历史文章自行搜索。

多余的话我就不多说了直接上代码。注:向右滑动可以查看完整代码。

抖音作品页

Import "shanhai.lua"
shanhai.execute("am start -a android.intent.action.VIEW -d snssdk1128://aweme/detail/6814634004747193615")
@16892434
16892434 / URL Schemes.md
Created September 17, 2024 13:53 — forked from zhuziyi1989/URL Schemes.md
常用 URL Schemes 收集。

** 由于此文年事已久,可能某些URL Schemes已失效,可在评论区留言指出!(最后更新于 2024.4.16)

关于 URL Scheme 你知道多少?

iOS系统中

由于苹果的各应用都是在沙盒中,不能够互相之间访问或共享数据。但是苹果还是给出了一个可以在APP之间跳转的方法:URL Scheme。简单的说,URL Scheme就是一个可以让 APP 相互之间可以跳转的协议。每个 APP 的URL Scheme都是不一样的,如果存在一样的URL Scheme,那么系统就会响应先安装那个 APP 的URL Scheme,因为后安装的 APP 的URL Scheme被覆盖掉了,是不能被调用的。

Android系统中

@16892434
16892434 / workers.js
Created June 20, 2024 01:44 — forked from tennc/workers.js
这个更棒~ 速度更快~
// List of domains bind to your WorkersProxy.
const domain_list = ['https://你的cloudflareWorker应用地址/']
// Website you intended to retrieve for users.
const upstream = 'https://需要加速的网站的地址/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = 'https://需要加速的网站移动端的地址/'
// Countries and regions where you wish to suspend your service.
@16892434
16892434 / README_hfd.md
Created April 8, 2024 00:29 — forked from padeoe/README_hfd.md
CLI-Tool for download Huggingface models and datasets with aria2/wget+git

🤗Huggingface Model Downloader

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 smartly utilizes wget or aria2 for LFS files and git clone for the rest.

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 Support: For gated models that require Huggingface login, use --hf_username and --hf_token to authenticate.
  • 🪞 Mirror Site Support: Set up with HF_ENDPOINT environment variable.
@16892434
16892434 / fix-duplicate-class-android-studio.md
Created February 1, 2024 06:37 — forked from danielcshn/fix-duplicate-class-android-studio.md
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: