Skip to content

Instantly share code, notes, and snippets.

View ddPn08's full-sized avatar
🍡

ddPn08 ddPn08

🍡
View GitHub Profile
@ddPn08
ddPn08 / networks--lora.py.patch
Last active July 7, 2023 22:23
leco for sd-scripts
diff --git a/networks/lora.py b/networks/lora.py
index b6788b9..5c57cef 100644
--- a/networks/lora.py
+++ b/networks/lora.py
@@ -71,15 +71,14 @@ class LoRAModule(torch.nn.Module):
torch.nn.init.zeros_(self.lora_up.weight)
self.multiplier = multiplier
- self.org_module = org_module # remove in applying
+ self.org_module = [org_module] # remove in applying
from typing import *
from .base import BaseConfig
from latopia.f0_extractor import F0_METHODS_TYPE
class ViTsInferenceConfig(BaseConfig):
model_path: str
speaker_id: int = 0
# (sd, diffusers)
unet_conversion_map = [
("time_embed.0.weight", "time_embedding.linear_1.weight"),
("time_embed.0.bias", "time_embedding.linear_1.bias"),
("time_embed.2.weight", "time_embedding.linear_2.weight"),
("time_embed.2.bias", "time_embedding.linear_2.bias"),
("input_blocks.0.0.weight", "conv_in.weight"),
("input_blocks.0.0.bias", "conv_in.bias"),
("middle_block_out.0.weight", "controlnet_mid_block.weight"),
("middle_block_out.0.bias", "controlnet_mid_block.bias"),
@ddPn08
ddPn08 / Dockerfile.tensorrt-diffusion
Last active February 1, 2023 18:20
Docker container for TensorRT Stable Diffusion Demo
FROM nvidia/cuda:11.7.0-cudnn8-devel-ubuntu20.04 as tensorrt
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt upgrade -y \
&& apt install software-properties-common -y \
&& add-apt-repository --yes ppa:deadsnakes/ppa
RUN apt update && apt install build-essential curl git-core tensorrt tensorrt-dev tensorrt-libs -y
@echo off
python -V
pip -V
python -c "import torch; print(torch.__version__)"
pause
wget https://github.com/derailed/k9s/releases/latest/download/k9s_Linux_x86_64.tar.gz
tar -zxvf k9s_Linux_x86_64.tar.gz -C /tmp
mv /tmp/k9s /usr/local/bin/
chmod +x /usr/local/bin/k9s
cat <<EOF > /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system
apt-get install -y iptables arptables ebtables
update-alternatives --set iptables /usr/sbin/iptables-legacy
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
update-alternatives --set arptables /usr/sbin/arptables-legacy