Skip to content

Instantly share code, notes, and snippets.

@linoytsaban
linoytsaban / fast_qwen_edit.py
Last active October 24, 2025 15:59
Fast Qwen Image Edit 2509 with diffusers: using Qwen Rapid AIO for 4-step inference, and Qwen next scene LoRA for cinematic image sequences with natural visual progression from frame to frame
import torch
from diffusers.models import QwenImageTransformer2DModel
from diffusers import QwenImageEditPlusPipeline
from diffusers.utils import load_image
dtype = torch.bfloat16
device = "cuda" if torch.cuda.is_available() else "cpu"
# load pipeline with Rapid AIO transfromer
pipe = QwenImageEditPlusPipeline.from_pretrained("Qwen/Qwen-Image-Edit-2509",
@linoytsaban
linoytsaban / wan22_with_lora.py
Created July 28, 2025 16:43
Run Wan2.2 14B I2V with Wan2.1 few step LoRAs for speedup
!pip install git+https://github.com/huggingface/diffusers.git@refs/pull/12004/head
import torch
import numpy as np
from diffusers import WanImageToVideoPipeline
from diffusers.utils import export_to_video, load_image
model_id = "Wan-AI/Wan2.2-I2V-A14B-Diffusers"
dtype = torch.bfloat16
device = "cuda"
@linoytsaban
linoytsaban / flux_with_cfg
Last active December 9, 2024 06:26
Flux with CFG and negative prompts
# download FluxCFGPipline
!wget https://raw.githubusercontent.com/linoytsaban/diffusers/refs/heads/dreambooth-lora-flux-exploration/examples/community/pipeline_flux_with_cfg.py
# load pipeline
import diffusers
import torch
from pipeline_flux_with_cfg import FluxCFGPipeline
pipe = FluxCFGPipeline.from_pretrained("black-forest-labs/FLUX.1-dev",
torch_dtype=torch.bfloat16)