Sovereign 8s.is mirror of standardgalactic/EditCrafter
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-04-19 12:08:03 +09:00
assets first commit 2026-04-19 12:08:03 +09:00
configs first commit 2026-04-19 12:08:03 +09:00
examples first commit 2026-04-19 12:08:03 +09:00
transforms first commit 2026-04-19 12:08:03 +09:00
.gitignore first commit 2026-04-19 12:08:03 +09:00
free_lunch_utils.py first commit 2026-04-19 12:08:03 +09:00
inversion_utils.py first commit 2026-04-19 12:08:03 +09:00
inversion_utils_sdxl.py first commit 2026-04-19 12:08:03 +09:00
latent_sdxl.py first commit 2026-04-19 12:08:03 +09:00
model.py first commit 2026-04-19 12:08:03 +09:00
README.md first commit 2026-04-19 12:08:03 +09:00
sync_tiled_decode.py first commit 2026-04-19 12:08:03 +09:00
text_guided_edit.py first commit 2026-04-19 12:08:03 +09:00
text_guided_edit_xl.py first commit 2026-04-19 12:08:03 +09:00

EditCrafter: Tuning-free High-Resolution Image Editing via Pretrained Diffusion Model

Dataset

Kunho Kim1, Sumin Seo2, Yongjun Cho3, Hyungjin Chung4

1NC AI   2Medipixel, Inc.   3MAUM.AI   4EverEx


TL;DR: EditCrafter edits images at resolutions up to 4K (4096x4096) using pretrained text-to-image diffusion models (SD 1.5 / 2.1 / SDXL) without any fine-tuning or optimization. It combines tiled DDIM inversion for identity preservation with noise-damped manifold-constrained classifier-free guidance (NDCFG++) for high-quality text-guided editing.

Setup

Requirements

  • Python >= 3.9
  • PyTorch >= 2.0
  • CUDA-capable GPU (24GB VRAM for 4K with SDXL)

Installation

pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
pip install diffusers transformers accelerate
pip install omegaconf scipy Pillow numpy tqdm einops munch

Checkpoints are downloaded automatically from Hugging Face on the first run.

Editing with text prompts

EditCrafter provides two scripts:

Script Backbone Training Resolution Max Editing Resolution
text_guided_edit.py Stable Diffusion 1.5 / 2.1 512x512 2048x2048
text_guided_edit_xl.py SDXL 1.0 1024x1024 4096x4096

Key Arguments

Argument Description
--img_path Path to the input image
--editing_prompt Text describing the desired edit
--config YAML config controlling resolution, dilation, and NDCFG settings
--guidance_scale Classifier-free guidance scale (default: 0.5)
--guidance_type Guidance type: cfg or cfgpp (default: cfgpp)

Available Configs

Stable Diffusion 1.5 / 2.1
Config Resolution
sd1.5_1024x1024.yaml 1024x1024
sd1.5_2048x1024.yaml 2048x1024
sd1.5_2048x2048.yaml 2048x2048
sd1.5_2048x2048_disperse.yaml 2048x2048 (with dispersion)
sd2.1_1024x1024.yaml 1024x1024
sd2.1_2048x1024.yaml 2048x1024
sd2.1_2048x2048.yaml 2048x2048
sd2.1_2048x2048_disperse.yaml 2048x2048 (with dispersion)
SDXL
Config Resolution
sdxl_2048x2048.yaml 2048x2048
sdxl_4096x2048.yaml 4096x2048
sdxl_4096x4096.yaml 4096x4096
sdxl_4096x4096_disperse.yaml 4096x4096 (with dispersion)

Stable Diffusion 2.1

4x (1024x1024)
...on a rainy street, reflecting city lights. → ...in a desert setting at sunset.

Original

Edited
python text_guided_edit.py \
    --pretrained_model_name_or_path Manojb/stable-diffusion-2-1-base \
    --img_path examples/sd21_4x_car_original.jpg \
    --editing_prompt "A high-resolution image of a shiny black sports car in a desert setting at sunset." \
    --config ./configs/sd2.1_1024x1024.yaml \
    --guidance_scale 0.5 \
    --seed 2024 \
    --guidance_type cfgpp
8x (2048x1024)
tiger → panda

Original

Edited
python text_guided_edit.py \
    --pretrained_model_name_or_path Manojb/stable-diffusion-2-1-base \
    --img_path examples/sd21_8x_tiger_original.jpg \
    --editing_prompt "A majestic panda emerging from the dense jungle foliage, its piercing eyes focused forward and sunlight filtering through the canopy." \
    --config ./configs/sd2.1_2048x1024.yaml \
    --guidance_scale 0.5 \
    --seed 2024 \
    --guidance_type cfgpp
16x (2048x2048)
chameleon → koala

Original

Edited
python text_guided_edit.py \
    --pretrained_model_name_or_path Manojb/stable-diffusion-2-1-base \
    --img_path examples/sd21_16x_chameleon_original.jpg \
    --editing_prompt "A koala perched on a branch, centered with focus on its vibrant scales." \
    --config ./configs/sd2.1_2048x2048.yaml \
    --guidance_scale 0.5 \
    --seed 2024 \
    --guidance_type cfgpp

SDXL 1.0

4x (2048x2048)
dandelion seeds → balloon

Original

Edited
python text_guided_edit_xl.py \
    --pretrained_model_name_or_path stabilityai/stable-diffusion-xl-base-1.0 \
    --img_path examples/sdxl_4x_dandelion_original.jpg \
    --editing_prompt "A tranquil image of a child blowing balloon in a meadow, with soft focus on floating seeds." \
    --config ./configs/sdxl_2048x2048.yaml \
    --guidance_scale 0.5 \
    --seed 2024 \
    --guidance_type cfgpp
8x (4096x2048)
cherry blossom → maple

Original

Edited
python text_guided_edit_xl.py \
    --pretrained_model_name_or_path stabilityai/stable-diffusion-xl-base-1.0 \
    --img_path examples/sdxl_8x_cherry_original.jpg \
    --editing_prompt "A single maple tree in a field, with golden leaves scattered around and a tranquil mountain in the background." \
    --config ./configs/sdxl_4096x2048.yaml \
    --guidance_scale 0.5 \
    --seed 2024 \
    --guidance_type cfgpp
16x (4096x4096)
forest → burning forest

Original

Edited
python text_guided_edit_xl.py \
    --pretrained_model_name_or_path stabilityai/stable-diffusion-xl-base-1.0 \
    --img_path examples/sdxl_16x_bottle_original.jpg \
    --editing_prompt "A glass bottle with a miniature burning forest inside covered with fire, floating above an open field at dusk." \
    --config ./configs/sdxl_4096x4096.yaml \
    --guidance_scale 0.5 \
    --seed 2024 \
    --guidance_type cfgpp

Citation

If you find this work useful, please cite:

@inproceedings{kim2026editcrafter,
    title={EditCrafter: Tuning-free High-Resolution Image Editing via Pretrained Diffusion Model},
    author={Kim, Kunho and Seo, Sumin and Cho, Yongjun and Chung, Hyungjin},
    booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW)},
    year={2026}
}

Acknowledgement

This codebase is built upon ScaleCrafter. We thank the authors for their excellent work.

Contact

For questions or issues, please open a GitHub issue or contact Kunho Kim.