### Environment Setup and Dataset Loading Source: https://github.com/stepfun-ai/step1x-edit/blob/main/GEdit-Bench/EVAL.md Instructions to create and activate a Conda environment using a specified yml file, followed by loading the GEdit-Bench dataset using the Hugging Face `datasets` library. ```bash conda env create -f qwen25vl_environment.yml conda activate qwen25vl ``` ```python from datasets import load_dataset dataset = load_dataset("stepfun-ai/GEdit-Bench") ``` -------------------------------- ### Install Flash-Attention Source: https://github.com/stepfun-ai/step1x-edit/blob/main/README.md Provides instructions to install the flash-attention library, which is crucial for efficient attention mechanisms. It involves running a Python script to find a suitable pre-built wheel for your system and then installing it. ```python python scripts/get_flash_attn.py ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/stepfun-ai/step1x-edit/blob/main/README.md Installs all required Python packages for the Step1X-Edit model by reading from the requirements.txt file. Ensure you have Python 3.10.0+ and a compatible PyTorch installation with CUDA. ```bash pip install -r requirements.txt ``` -------------------------------- ### Launch Gradio Demo Source: https://github.com/stepfun-ai/step1x-edit/blob/main/README.md Starts the Gradio web interface for the Step1X-Edit model. Requires setting the `model_path` in `gradio_app.py` to the local model weights. The demo typically runs on `localhost:32800`. ```python python gradio_app.py ``` -------------------------------- ### Run Finetuning Script Source: https://github.com/stepfun-ai/step1x-edit/blob/main/README.md Initiates the fine-tuning process for the Step1X-Edit model. This script is adapted from kohya-ss/sd-scripts and can fine-tune on a single 24GB GPU for 1024 resolution. It uses a custom dataset configuration file. ```bash bash ./scripts/finetuning.sh ``` -------------------------------- ### Run Default Inference Script Source: https://github.com/stepfun-ai/step1x-edit/blob/main/README.md Executes the default inference code using non-quantified weights. Supports options like `--quantized` for fp8 weights to save GPU memory or `--offload` to move modules to CPU. ```bash scripts/run_examples.sh ``` -------------------------------- ### Run Multi-GPU Inference Script Source: https://github.com/stepfun-ai/step1x-edit/blob/main/README.md Enables inference across multiple GPUs. Allows configuration of GPU count (`GPU`), xDiT parameters (`--ulysses_degree`, `--ring_degree`, `--cfg_degree`), and TeaCache acceleration (`--teacache`). ```bash scripts/run_examples_parallel.sh ``` -------------------------------- ### Calculate Statistics Source: https://github.com/stepfun-ai/step1x-edit/blob/main/GEdit-Bench/EVAL.md Command to run the `calculate_statistics.py` script for analyzing evaluation results. It generates scores for semantics, quality, and overall performance, broken down by edit category and aggregate metrics. ```bash python calculate_statistics.py --model_name your_model --save_path score_dir --backbone gpt4o --language all ``` -------------------------------- ### Image Directory Structure Source: https://github.com/stepfun-ai/step1x-edit/blob/main/GEdit-Bench/EVAL.md Defines the required directory structure for organizing generated images. This structure categorizes images by method name and edit task, with subdirectories for Chinese ('cn') and English ('en') instructions. ```bash results/ ├── {method_name}/ │ └── fullset/ │ └── {edit_task}/ │ ├── cn/ # Chinese instructions │ │ ├── key1.png │ │ ├── key2.png │ │ └── ... │ └── en/ # English instructions │ ├── key1.png │ ├── key2.png │ └── ... ``` -------------------------------- ### Run Evaluation Script Source: https://github.com/stepfun-ai/step1x-edit/blob/main/GEdit-Bench/EVAL.md Commands to execute the `run_gedit_score.py` script for evaluating models. It supports different backbones like 'gpt4o' and 'qwen25vl', requiring the model name, save directory, and directory of edited images. ```bash python run_gedit_score.py --model_name your_model --save_dir score_dir --backbone gpt4o --edited_images_dir your_edited_images_dir ``` ```bash python run_gedit_score.py --model_name your_model --save_dir score_dir --backbone qwen25vl --edited_images_dir your_edited_images_dir ``` -------------------------------- ### Step1X-Edit Model Updates and Features Source: https://github.com/stepfun-ai/step1x-edit/blob/main/README.md Details on recent advancements and features for the Step1X-Edit model, including text-to-image generation, improved editing quality, Lora finetuning, and support for FP8 weights. ```APIDOC Project: Step1X-Edit Key Features & Updates: 1. **v1.1 Release (Jul 09, 2025)**: - Added support for text-to-image (T2I) generation tasks. - Improved image editing quality and instruction-following performance. - Evaluation metrics released for GEdit-Bench-EN (Full set). - Intermediate evaluation results available. - Metrics: G_SC, G_PQ, G_O (GPT-4.1), Q_SC, Q_PQ, Q_O (Qwen2.5-VL-72B). 2. **Teacache & Parallel Inference (Jun 17, 2025)**: - Added support for Teacache. - Added support for parallel inference. 3. **Lora Finetuning (May 22, 2025)**: - Supports Lora finetuning on a single 24GB GPU. - Hand-fixing Lora for anime characters released. 4. **ComfyUI Plugin (Apr 30, 2025)**: - Step1X-Edit ComfyUI Plugin available. - Community contributions: quank123wip/ComfyUI-Step1X-Edit, raykindle/ComfyUI_Step1X-Edit. 5. **FP8 Weights (Apr 27, 2025)**: - Updated inference code and model weights for Step1X-Edit-FP8. - Available at meimeilook/Step1X-Edit-FP8 and rkfg/Step1X-Edit-FP8. 6. **Online Demo (Apr 26, 2025)**: - Image editing directly in the online demo available. - Link: https://huggingface.co/spaces/stepfun-ai/Step1X-Edit 7. **Evaluation Code & Benchmark (Apr 25, 2025)**: - Released evaluation code and benchmark data. - Download GEdit-Bench: https://huggingface.co/datasets/stepfun-ai/GEdit-Bench 8. **Inference Code & Model Weights (Apr 25, 2025)**: - Released inference code and model weights. - Available on ModelScope and HuggingFace. - ModelScope: https://www.modelscope.cn/models/stepfun-ai/Step1X-Edit - HuggingFace: https://huggingface.co/stepfun-ai/Step1X-Edit 9. **Technical Report (Apr 25, 2025)**: - Technical report made available as open source. - Link: https://arxiv.org/abs/2504.17761 Evaluation Metrics Table: | Models | G_SC ⬆️ | G_PQ ⬆️ | G_O ⬆️ | Q_SC ⬆️ | Q_PQ ⬆️ | Q_O ⬆️ | |--------------------|---------|---------|--------|---------|---------|--------| | Step1X-Edit (v1.0) | 7.13 | 7.00 | 6.44 | 7.39 | 7.28 | 7.07 | | Step1X-Edit (v1.1) | 7.66 | 7.35 | 6.97 | 7.65 | 7.41 | 7.35 | ``` -------------------------------- ### Run Script for Fixing Hands Source: https://github.com/stepfun-ai/step1x-edit/blob/main/README.md Executes a specific script designed to reproduce inference results for cases involving fixing corrupted hands, likely utilizing LoRA weights. ```bash bash scripts/run_examples_fix_hand.sh ``` -------------------------------- ### Dataset Metadata Format Source: https://github.com/stepfun-ai/step1x-edit/blob/main/README.md Defines the structure for the metadata file used in custom dataset configuration for fine-tuning. It's a JSON file mapping target image paths to their corresponding source image paths and editing instructions (captions). ```APIDOC { "": { "ref_image_path": "", "caption": "" }, ... } ``` -------------------------------- ### Citation Source: https://github.com/stepfun-ai/step1x-edit/blob/main/README.md BibTeX entry for the Step1X-Edit paper, providing details for academic citation. ```APIDOC @article{liu2025step1x-edit, title={Step1X-Edit: A Practical Framework for General Image Editing}, author={Shiyu Liu and Yucheng Han and Peng Xing and Fukun Yin and Rui Wang and Wei Cheng and Jiaqi Liao and Yingming Wang and Honghao Fu and Chunrui Han and Guopeng Li and Yuang Peng and Quan Sun and Jingwei Wu and Yan Cai and Zheng Ge and Ranchen Ming and Lei Xia and Xianfang Zeng and Yibo Zhu and Binxing Jiao and Xiangyu Zhang and Gang Yu and Daxin Jiang}, journal={arXiv preprint arXiv:2504.17761}, year={2025} } ``` -------------------------------- ### Inference with LoRA Weights Source: https://github.com/stepfun-ai/step1x-edit/blob/main/README.md Performs inference using the model with specified LoRA weights. The `--lora` argument points to the path of the LoRA weights file. This is useful for tasks like fixing corrupted hands. ```python python inference.py --input_dir ./examples \ --model_path /data/work_dir/step1x-edit/ \ --json_path ./examples/prompt_cn.json \ --output_dir ./output_cn \ --seed 1234 --size_level 1024 \ --lora 20250521_001-lora256-alpha128-fix-hand-per-epoch/step1x-edit_test.safetensors ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.