hc0 commited on
Commit
c4c9d11
·
verified ·
1 Parent(s): 94b56d5

RefRes v5 for Qwen-Image-2.1 / Qwen-Image-2.1-Turbo

Browse files
.gitattributes CHANGED
@@ -33,3 +33,8 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ assets/example_man.jpg filter=lfs diff=lfs merge=lfs -text
37
+ assets/example_woman.jpg filter=lfs diff=lfs merge=lfs -text
38
+ assets/refres_cover.jpg filter=lfs diff=lfs merge=lfs -text
39
+ assets/refres_teaser.mp4 filter=lfs diff=lfs merge=lfs -text
40
+ assets/refres_zone.png filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Qwen RESEARCH LICENSE AGREEMENT
2
+
3
+ Qwen RESEARCH LICENSE AGREEMENT Release Date: September 20, 2026
4
+
5
+ By clicking to agree or by using or distributing any portion or element of the Qwen Materials, you will be deemed to have recognized and accepted the content of this Agreement, which is effective immediately.
6
+
7
+ 1. Definitions
8
+ a. This Qwen RESEARCH LICENSE AGREEMENT (this "Agreement") shall mean the terms and conditions for use, reproduction, distribution and modification of the Materials as defined by this Agreement.
9
+ b. "We" (or "Us") shall mean Hangzhou Tongyi Laboratory Technology Co., Ltd.
10
+ c. "You" (or "Your") shall mean a natural person or legal entity exercising the rights granted by this Agreement and/or using the Materials for any purpose and in any field of use.
11
+ d. "Third Parties" shall mean individuals or legal entities that are not under common control with us or you.
12
+ e. "Qwen" shall mean the large language models, diffusion models, and software and algorithms, consisting of trained model weights, parameters (including optimizer states), machine-learning model code, inference-enabling code, training-enabling code, fine-tuning enabling code and other elements of the foregoing distributed by us.
13
+ f. "Materials" shall mean, collectively, our proprietary Qwen and Documentation (and any portion thereof) made available under this Agreement.
14
+ g. "Source" form shall mean the preferred form for making modifications, including but not limited to model source code, documentation source, and configuration files.
15
+ h. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
16
+ i. "Non-Commercial" shall mean for research or evaluation purposes only.
17
+
18
+ 2. Grant of Rights
19
+ a. You are granted a non-exclusive, worldwide, non-transferable and royalty-free limited license under our intellectual property or other rights owned by us embodied in the Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the Materials FOR NON-COMMERCIAL PURPOSES ONLY.
20
+ b. You shall not use the Materials for any commercial purpose without obtaining a separate commercial license from us. If you wish to use the Materials commercially, you shall request a license from us at model-business@notice.qwencloud.com.
21
+
22
+ 3. Redistribution
23
+ Subject to Section 2 (Grant of Rights), you may distribute copies or make the Materials, or derivative works thereof, available as part of a product or service that contains any of them, with or without modifications, and in Source or Object form, provided that you meet the following conditions:
24
+ a. You shall give any other recipients of the Materials or derivative works a copy of this Agreement;
25
+ b. You shall cause any modified files to carry prominent notices stating that you changed the files;
26
+ c. You shall retain in all copies of the Materials that you distribute the following attribution notices within a "Notice" text file distributed as a part of such copies: "Qwen is licensed under the Qwen RESEARCH LICENSE AGREEMENT, Copyright (c) 2026 Hangzhou Tongyi Laboratory Technology Co., Ltd. All Rights Reserved."; and
27
+ d. You may add your own copyright statement to your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of your modifications, or for any such derivative works as a whole, provided your use, reproduction, and distribution of the work otherwise complies with the terms and conditions of this Agreement.
28
+
29
+ 4. Rules of use
30
+ a. The Materials may be subject to export controls or restrictions in China, the United States or other countries or regions. You shall comply with applicable laws and regulations in your use of the Materials.
31
+ b. If you use the Materials or any outputs or results therefrom to create, train, fine-tune, or improve an AI model that is distributed or made available, you shall prominently display “Built with Qwen” or “Improved using Qwen” in the related product documentation.
32
+ c. You shall not use "Qwen" as the primary name or identifier of any derivative works or products; reasonable descriptive use (e.g., "fine-tuned from Qwen Image") is permitted.
33
+
34
+ 5. Intellectual Property
35
+ a. We retain ownership of all intellectual property rights in and to the Materials and derivatives made by or for us. Conditioned upon compliance with the terms and conditions of this Agreement, with respect to any derivative works and modifications of the Materials that are made by you, you are and will be the owner of such derivative works and modifications.
36
+ b. No trademark license is granted to use the trade names, trademarks, service marks, or product names of us, except as required to fulfill notice requirements under this Agreement or as required for reasonable and customary use in describing and redistributing the Materials.
37
+ c. If you commence a lawsuit or other proceedings (including a cross-claim or counterclaim in a lawsuit) against us or any entity alleging that the Materials or any output therefrom, or any part of the foregoing, infringe any intellectual property or other right owned or licensable by you, then all licenses granted to you under this Agreement shall terminate as of the date such lawsuit or other proceeding is commenced or brought.
38
+
39
+ 6. Disclaimer of Warranty and Limitation of Liability
40
+ a. We are not obligated to support, update, provide training for, or develop any further version of the Qwen Materials or to grant any license thereto.
41
+ b. THE MATERIALS ARE PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR PURPOSE. WE MAKE NO WARRANTY AND ASSUME NO RESPONSIBILITY FOR THE SAFETY OR STABILITY OF THE MATERIALS AND ANY OUTPUT THEREFROM.
42
+ c. IN NO EVENT SHALL WE BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE MATERIALS OR ANY OUTPUT OF IT, NO MATTER HOW IT’S CAUSED.
43
+ d. You will defend, indemnify and hold harmless us from and against any claim by any third party arising out of or related to your use or distribution of the Materials.
44
+
45
+ 7. Survival and Termination.
46
+ a. The term of this Agreement shall commence upon your acceptance of this Agreement or access to the Materials and will continue in full force and effect until terminated in accordance with the terms and conditions herein.
47
+ b. We may terminate this Agreement if you breach any of the terms or conditions of this Agreement. Upon termination of this Agreement, you must delete and cease use of the Materials. Sections 6 and 8 shall survive the termination of this Agreement.
48
+
49
+ 8. Governing Law and Jurisdiction.
50
+ a. This Agreement and any dispute arising out of or relating to it will be governed by the laws of China, without regard to conflict of law principles, and the UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement.
51
+ b. The People's Courts in Hangzhou City shall have exclusive jurisdiction over any dispute arising out of this Agreement.
52
+
53
+ 9. Other Terms and Conditions.
54
+ a. Any arrangements, understandings, or agreements regarding the Material not stated herein are separate from and independent of the terms and conditions of this Agreement. You shall request a separate license from us, if you use the Materials in ways not expressly agreed to in this Agreement.
55
+ b. We shall not be bound by any additional or different terms or conditions communicated by you unless expressly agreed.
NOTICE ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ Qwen is licensed under the Qwen RESEARCH LICENSE AGREEMENT, Copyright (c) 2026 Hangzhou Tongyi Laboratory Technology Co., Ltd. All Rights Reserved.
2
+
3
+ qwen-image-2.1/RefRes-v5-qwen-image-2.1.safetensors is a LoRA adapter (derivative work) trained on top of Qwen-Image-2.1. It is distributed under the Qwen Research License Agreement (see LICENSE) for non-commercial use only.
4
+
5
+ Training data: freely licensed photos from Wikimedia Commons. The photos are not included in this repository.
6
+ Example images in assets/ show AI-generated fictional people.
README.md ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: qwen-research
4
+ license_link: LICENSE
5
+ base_model:
6
+ - Qwen/Qwen-Image-2.1
7
+ - Qwen/Qwen-Image-2.1-Turbo
8
+ base_model_relation: adapter
9
+ pipeline_tag: image-to-image
10
+ library_name: diffusers
11
+ tags:
12
+ - lora
13
+ - image-restoration
14
+ - face-restoration
15
+ - super-resolution
16
+ - reference-based
17
+ - qwen-image-2.1
18
+ ---
19
+
20
+ # RefRes
21
+
22
+ <video src="https://huggingface.co/hc0/RefRes/resolve/main/assets/refres_teaser.mp4" poster="https://huggingface.co/hc0/RefRes/resolve/main/assets/refres_cover.jpg" autoplay muted loop playsinline width="100%"></video>
23
+
24
+ **One damaged photo + a few photos of the same person → the photo, restored, with the person's real face.**
25
+ Adapters for image-editing models — available now for Qwen-Image-2.1 and Qwen-Image-2.1-Turbo, FLUX.2 [klein] in training.
26
+
27
+ ![Example: woman](assets/example_woman.jpg)
28
+ ![Example: man](assets/example_man.jpg)
29
+
30
+ <sub>Examples use AI-generated fictional people; the inputs were degraded on purpose. Turbo + RefRes + Texture-Fix VAE, 8 steps.</sub>
31
+
32
+ ## Why references
33
+
34
+ ![Where the restorations land](assets/refres_zone.png)
35
+
36
+ A restorer without references has to guess the face. RefRes looks at other photos of the same person, so the
37
+ result stays that person: on 48 restorations of unseen people, identity similarity rises from 0.73 to 0.91–0.93,
38
+ and the result is about seven times closer to the real photo (LPIPS 0.42 → 0.06). One reference already works;
39
+ five to nine work best.
40
+
41
+ ## Quick start
42
+
43
+ | | |
44
+ |---|---|
45
+ | Image 1 | the photo to restore |
46
+ | Images 2 … | 1–9 photos of the same person |
47
+ | Model | Qwen-Image-2.1-Turbo (8 steps) or Qwen-Image-2.1 (40 steps) |
48
+ | File | `qwen-image-2.1/RefRes-v5-qwen-image-2.1.safetensors` |
49
+ | LoRA strength | 1.0 |
50
+ | CFG | 1, no negative prompt |
51
+ | VAE | [Texture-Fix VAE](https://huggingface.co/madebyollin/texture-fix-vae-for-qwen-image-2.1) recommended |
52
+
53
+ <details>
54
+ <summary>Prompt (5 references, woman — change <i>woman/her</i> and the image count as needed)</summary>
55
+
56
+ ```text
57
+ Restore image 1, a photo of a woman, into a sharp, clear, high-resolution photograph with crisp fine detail. Images 2 to 6 are other photos of the same woman; use them only as identity reference to recover her true facial features and fine details. Keep image 1's pose, expression, framing, clothing, background and colors unchanged. Remove every trace of low resolution and degradation: pixelation, soft or blurry upscaling, blur, all kinds of noise and film grain, JPEG and WebP compression artifacts, color banding, as well as any overlaid text, stickers, emoji or watermarks. The result must look natively high resolution: sharp, clean and detailed, with no grain, no noise and no low-resolution softness.
58
+ ```
59
+ </details>
60
+
61
+ ## Good to know
62
+
63
+ - Generative restoration: detail is reconstructed from the references, not recovered evidence. Not for forensic use.
64
+ - Only restore photos you have the right to edit.
65
+ - Each adapter follows its base model's license; the Qwen-Image-2.1 adapter: Qwen Research License (non-commercial). Built with Qwen. Trained on freely licensed photos from Wikimedia Commons; the photos themselves are not distributed.
assets/example_man.jpg ADDED

Git LFS Details

  • SHA256: 7d2f0fcef704870562f3fa01b543e5a4ae013989721beacdc78fa0897c085a26
  • Pointer size: 131 Bytes
  • Size of remote file: 268 kB
assets/example_woman.jpg ADDED

Git LFS Details

  • SHA256: 00e207a6cece8113678b2a45a1b6f6c6a9d1011bff89c8dda37dc59e6c04aaa4
  • Pointer size: 131 Bytes
  • Size of remote file: 286 kB
assets/refres_cover.jpg ADDED

Git LFS Details

  • SHA256: 7ca060e5f8e4f71585c9818d5d845c8e6ca905489e0ac2bbd565e2617a90936f
  • Pointer size: 131 Bytes
  • Size of remote file: 251 kB
assets/refres_teaser.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c377717724acb1ab3dbdd82925d69269de552859f9d707dc34acd3384224eaf
3
+ size 1268424
assets/refres_zone.png ADDED

Git LFS Details

  • SHA256: 7d18cda2d94802a634a3e2ce555ee5757bb545cf3ded74e024fa69993c402cbb
  • Pointer size: 131 Bytes
  • Size of remote file: 181 kB
qwen-image-2.1/RefRes-v5-qwen-image-2.1.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7e247aaaeb69b3599bd527a15ee883ff0defa6160f096879f36bcef007f0019c
3
+ size 637587792