> ## Content Index
> Fetch the complete content index at: https://www.hubwiz.com/blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# Qwen-image-edit 本地部署实践
- URL: https://www.hubwiz.com/blog/qwen-image-edit-local-deployment/
- Published: 2025-11-10T08:23:00.000Z
- Updated: 2025-11-10T08:23:00.000Z
- Description: 我们尝试在搭载 AMD Ryzen AI Max+395 和 Intel Core Ultra 125H 的 AI PC 上本地运行 Qwen-Image-Edit 模型，以执行典型的照片编辑任务。
- Author: admin
- Tags: APPLICATION, #Import 2026-10-14 14:41

Nano Banana 和 Qwen 的简单对比表明，后者表现相当出色。因此，我们尝试在搭载 AMD Ryzen AI Max+395 和 Intel Core Ultra 125H 的 AI PC 上本地运行 Qwen-Image-Edit 模型，以执行典型的照片编辑任务。

以下测试使用与之前相同的设置，具体来说是 Windows 11 上的 rocm79-py312 环境。

运行 Qwen-Image-Edit 最简单的方法是使用 HuggingFace Diffusers 编写 Python 脚本。Strix Halo 可以直接用作 CUDA 设备，但无论我们将显存设置为 96GB 还是 64GB，都会遇到内存不足的错误，导致无法进行全精度执行。

![](https://www.hubwiz.com/blog/content/images/2025/11/image-34.png)

在 AI 图像处理领域，更常见的运行方式是通过 ComfyUI，它提供了一个 FP8 精度的推理实现。以下步骤适用于像我一样更熟悉代码和命令行而非特定 GUI 应用程序的程序员。

```
conda activate rocm79-py312 
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
#edit itrequirements.txt to comment out or delete the "torch", "torchvision", and "torchadio" lines ("torchsde" is fine, leave that one alone).
pip install -r requirements.txt
cd custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Manager comfyui-manager
```

然后下载模型检查点：

[qwen\_image\_edit\_fp8\_e4m3fn.safetensors](https://huggingface.co/Comfy-Org/Qwen-Image-Edit%5FComfyUI/blob/main/split%5Ffiles/diffusion%5Fmodels/qwen%5Fimage%5Fedit%5Ffp8%5Fe4m3fn.safetensors?ref=hubwiz.com) → `ComfyUI\models\diffusion_models\`

或

[qwen\_image\_edit\_2509\_fp8\_e4m3fn.safetensors](https://huggingface.co/Comfy-Org/Qwen-Image-Edit%5FComfyUI/blob/main/split%5Ffiles/diffusion%5Fmodels/qwen%5Fimage%5Fedit%5F2509%5Ffp8%5Fe4m3fn.safetensors?ref=hubwiz.com) → `ComfyUI\models\diffusion_models\`

以及

[qwen-Image-Edit-Lightning-8steps-V1.0.safetensors](https://huggingface.co/lightx2v/Qwen-Image-Lightning/blob/main/Qwen-Image-Edit-Lightning-8steps-V1.0.safetensors?ref=hubwiz.com) → `ComfyUI\models\loras\`

[qwen\_image\_vae.safetensors](https://huggingface.co/Comfy-Org/Qwen-Image%5FComfyUI/blob/main/split%5Ffiles/vae/qwen%5Fimage%5Fvae.safetensors?ref=hubwiz.com) → `ComfyUI\models\vae`

[qwen\_2.5\_vl\_7b\_fp8\_scaled.safetensors](https://huggingface.co/Comfy-Org/Qwen-Image%5FComfyUI/blob/main/split%5Ffiles/text%5Fencoders/qwen%5F2.5%5Fvl%5F7b%5Ffp8%5Fscaled.safetensors?ref=hubwiz.com) → `ComfyUI\models\text_encoders`

![](https://www.hubwiz.com/blog/content/images/2025/11/image-35.png)

最后，您可以将工作流保存到任何位置。

之后，您可以启动 ComfyUI。

```
python main.py
```

![](https://www.hubwiz.com/blog/content/images/2025/11/image-36.png)

在网页浏览器中打开 [http://127.0.0.1:8188](http://127.0.0.1:8188/?ref=hubwiz.com)，拖放我们刚刚下载的工作流，它会显示缺少节点类型。

![](https://www.hubwiz.com/blog/content/images/2025/11/image-37.png)

您可以通过页面顶部的管理器轻松安装缺失的节点。

![](https://www.hubwiz.com/blog/content/images/2025/11/image-38.png)

![](https://www.hubwiz.com/blog/content/images/2025/11/image-39.png)

任务提示为“将字符移动到左侧，正对着石碑，并删除其后面的字符。”，输入图像如下：

![](https://www.hubwiz.com/blog/content/images/2025/11/image-40.png)

首次运行时，性能相对较差，这对于 GPU 来说是正常的。背景中的人脸被移除，但手机没有被移除。总耗时：243 秒。

![](https://www.hubwiz.com/blog/content/images/2025/11/image-41.png)

从第二次运行开始，背景人物被干净利落地移除，前景主体仅在极少数情况下略微向左偏移——大致与官方网络服务中的 Qwen-Max 的性能相当。总运行时间约为 140-160 秒。系统峰值功耗约为 67 瓦，表明硬件的计算能力并未得到充分利用。

![](https://www.hubwiz.com/blog/content/images/2025/11/image-42.png)

鉴于 ComfyUI 支持 Intel GPU，我们价格更低的配备 48GB 显存的 Intel Core Ultra 125H 的性能如何？

环境设置：

```
python -m pip install torch==2.8.0 torchvision==0.23.0 torchaudio==2.8.0 --index-url https://download.pytorch.org/whl/xpu
python -m pip install intel-extension-for-pytorch==2.8.10+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
```

ComfyUI 的安装方式与上述相同。遗憾的是，48GB 的​​显存仍然不足以运行它。

![](https://www.hubwiz.com/blog/content/images/2025/11/image-43.png)

这正是 Intel GPU 的不足之处：在 PyTorch 中，它被用作 XPU 设备而不是 CUDA 设备。即使 CUDA 设备没有足够的显存，nunchaku 也可以通过将模型权重卸载到 CPU 和主内存来运行。但 Intel® PyTorch 扩展目前尚不支持此功能。

---

原文链接：[Qwen-image-edit on AMD Ryzen AI Max+395 "Strix Halo" & Intel Core Ultra 125H](https://medium.com/@GenerationAI/qwen-image-edit-on-amd-ryzen-ai-max-395-strix-halo-intel-core-ultra-125h-24ebd8809d74?ref=hubwiz.com)

汇智网翻译整理，转载请标明出处