Skip to content

Instantly share code, notes, and snippets.

```python
# model and lora migration from donor server to reciever server
MODEL_DIR = Path("./dreambooth_models")
TARGET_DIR = Path("./dreambooth_models")
@app.get("/get_model/{filename}")
@AbhinavJangra29
AbhinavJangra29 / gist:b5b295d9fe0eddf6ce945704b08f31e2
Last active January 8, 2025 09:06
loading loras in flux and quantising it all together
! pip install transformers diffusers peft bitsandbytes sentencepiece accelerate protobuf torch
import bitsandbytes as bnb
from transformers.quantizers.quantizers_utils import get_module_from_name
import torch.nn as nn
from diffusers import AutoPipelineForText2Image
import torch
from accelerate.utils import set_module_tensor_to_device, compute_module_sizes