How to use from the
Use from the
Diffusers library
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
from diffusers.utils import load_image

# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("BiliSakura/RSEdit-DiT-plus", dtype=torch.bfloat16, device_map="cuda")

prompt = "Turn this cat into a dog"
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")

image = pipe(image=input_image, prompt=prompt).images[0]

RSEdit-DiT-Modified

Local diffusers-compatible checkpoint with custom pipeline code.

Default Inference Settings

  • torch_dtype=torch.bfloat16
  • guidance_scale=4.5
  • guidance_interval=(0.0, 1.0) (default: guidance active for the full denoising schedule)
  • image_guidance_scale=None (falls back to guidance_scale)
  • num_inference_steps=50
  • clean_caption=False

Quick Start

import torch
from PIL import Image
from diffusers import DiffusionPipeline

model_dir = "/data/projects/RSEdit/models/BiliSakura/RSEdit-DiT-Modified"
img_path = "/data/projects/RSEdit/datasets/BiliSakura/RSCC-RSEdit-Test-Split/images/hurricane-florence_00000109_post_disaster_part1.png"
out_path = "/data/projects/RSEdit/outputs/hurricane-florence_00000109_rsedit_bf16_cfg4p5_seed12345.png"

prompt = "Severe flooding engulfed the area, submerging all six buildings up to their rooftops, causing partial wall collapses and significant structural weakening. Vegetation along the shoreline was stripped away by rushing waters, exposing bare earth and debris. Roads near the settlement became impassable due to mudslides and erosion, isolating the community. No intact structures remained visible, with every building classified as majorly damaged (Level 2) under disaster protocols."

pipe = DiffusionPipeline.from_pretrained(
    model_dir,
    custom_pipeline=f"{model_dir}/pipeline.py",
    torch_dtype=torch.bfloat16,
).to("cuda")

print("Pipeline:", pipe.__class__.__name__)
print("Transformer:", pipe.transformer.__class__.__name__)

image = Image.open(img_path).convert("RGB")
result = pipe(
    prompt=prompt,
    source_image=image,
    num_inference_steps=50,
    guidance_scale=4.5,
    image_guidance_scale=1.5,
    guidance_interval=(0.0, 1.0),  # default full-range guidance
    clean_caption=False,
    generator=torch.Generator(device="cuda").manual_seed(12345),
).images[0]

result.save(out_path)
print("Saved:", out_path)
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support