Downloads · 30 days
8
8% of all-time downloads
camenduru/FLUX.1-Kontext-dev-int4
FLUX.1-Kontext-dev-int4 is a image-to-image model from camenduru. Use it when you need one image transformed into another. It is set up for diffusers.
- pip install git+https://github.com/huggingface/diffusers.git
Downloads · 30 days
8
8% of all-time downloads
All-time downloads
102
Public
Parameters
6.1B
13.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors13.4 GB · 100%
How the weights are stored.
U85.9B · 97%
From the Hugging Face model README
pip install git+https://github.com/huggingface/diffusers.git
pip install -U bitsandbytes
pip install -U transformers
pip install sentencepiece
pip install protobuf
import torch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
import uuid
pipe = FluxKontextPipeline.from_pretrained("kpsss34/FLUX.1-Kontext-dev-int4", torch_dtype=torch.bfloat16)
pipe.to("cuda")
input_image = load_image("./1.jpg")
image = pipe(
image=input_image,
prompt="woman wearing dress",
guidance_scale=2.5,
num_inference_steps=30
).images[0]
filename = f"generated_image_{uuid.uuid4().hex}.png"
image.save(filename)
print(f"Saved image as {filename}")