IMPORTANT NOTICE

This project is licensed under a custom MIT License, **except** for the optional 
`codeformer` component, which is licensed under the Creative Commons 
Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0).  
If you require commercial use, you **must remove** `codeformer`.  
See the bottom of this file for full details and removal instructions.

---

Custom MIT License

Copyright (c) 2023 xaviviro
Copyright (c) 2025 Felipe Daragon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

- The above copyright notice and this permission notice shall be included in 
all copies or substantial portions of the Software.

- You may only use this Software with content (such as images) for which you 
have the necessary rights and permissions. Unauthorized use of third-party 
content is strictly prohibited.

- This Software is intended for educational and research purposes only. Use 
of this Software for malicious purposes, including but not limited to identity 
theft, invasion of privacy, or defamation, is strictly prohibited.

- By using this Software, you agree to comply with all applicable laws and 
to respect the rights and privacy of others. You agree to use the Software 
responsibly and ethically.

- The Software may contain protective mechanisms intended to prevent its use 
with illegal or unauthorized media.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF,
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---

## Additional License Notice: Optional `codeformer` Component

This project distribution optionally includes an old version of a component 
named `codeformer` (https://github.com/felipedaragon/codeformer),
developed by Shangchen Zhou.  
The `codeformer` component is **NOT** licensed under the MIT License. 
Instead, it is licensed under:

**Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)**  
License details: https://creativecommons.org/licenses/by-nc-sa/4.0/

Key points about this license:
- **Non-commercial use only**: You may not use `codeformer` for commercial purposes.
- **Attribution required**: You must credit the original creators.
- **ShareAlike**: If you modify and share `codeformer`, you must do so under the same license.

### How to Use This Project as MIT Only

If you wish to use this project solely under the MIT License (for example, 
for commercial purposes), you **must remove** the `codeformer` component.  
Please follow the instructions provided below:

- Remove the subdirectories basicsr, facelib and weights.
- Remove codeformer_wrapper.py
- Edit refacer.py and remove the import: codeformer_wrapper import enhance_image
- Within def reface_image, comment the line: output_path = enhance_image(output_path)
- That's all!

Failure to remove `codeformer` when required may violate the terms of its license.
