m0_74196153/White_to_Scene
模型介绍文件和版本Pull Requests讨论分析

White_to_Scene

LoRA adapter for Qwen-Image-Edit-2509: Convert white-background product photos to outdoor scenes

Overview

This repository contains the White_to_Scene LoRA adapter for Qwen-Image-Edit-2509, adapted for Huawei Ascend NPU inference.

Trigger word: 白底图转场景

The LoRA transforms white-background product images into contextual outdoor scenes while preserving product identity.

NPU Adaptation

  • Device: Huawei Ascend 910B
  • Framework: diffusers + torch_npu
  • Accuracy: Mean Pixel Error = 0.31%, SSIM = 0.997, PSNR = 45.2 dB (CPU vs NPU)
  • Latency: 8.3s (20 inference steps)

Quick Start

Requirements

pip install diffusers torch-npu transformers scikit-image pillow

Inference

python3 inference.py --image test_images/product.png \
    --prompt "白底图转场景, 将产品放在户外场景中" \
    --output result.png

Accuracy Evaluation

python3 evaluation/eval_accuracy.py \
    --image test_images/product.png \
    --prompt "白底图转场景, 将产品放在户外场景中" \
    --steps 20

Performance Benchmark

python3 evaluation/eval_performance.py \
    --image test_images/product.png \
    --prompt "白底图转场景, 将产品放在户外场景中" \
    --num_runs 3

Project Structure

White_to_Scene/
├── inference.py                 # Main inference script
├── README.md                    # This file
├── test_images/                 # Sample input images
├── evaluation/
│   ├── eval_accuracy.py         # CPU vs NPU accuracy comparison
│   ├── eval_performance.py      # Throughput & latency benchmark
│   ├── terminal_screenshot.py   # macOS-style screenshot generator
│   ├── take_screenshot.py       # Screenshot helper
│   ├── logs/                    # Evaluation results
│   └── screenshots/             # Output images & screenshots

Model Details

  • Base Model: Qwen/Qwen-Image-Edit-2509
  • LoRA Weight: 白底图转场景.safetensors (236 MB)
  • Training Platform: ModelScope Training Service
  • License: Apache 2.0

Adapted for Huawei Ascend NPU by @m0_74196153

下载使用量0