Instructions to use adsfda/NiRNE with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use adsfda/NiRNE with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("adsfda/NiRNE", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
|
Download README.md from adsfda/NiRNE: direct link, hf CLI and curl.
- Browser
- Download file 878 Bytes
-
https://huggingface.co/adsfda/NiRNE/resolve/main/README.md
- Command line
-
hf download hf://adsfda/NiRNE/README.md
-
curl -L -o README.md https://huggingface.co/adsfda/NiRNE/resolve/main/README.md
878 Bytes
| license: apache-2.0 | |
| pipeline_tag: image-to-image | |
| library_name: diffusers | |
| # Model Card for NiRNE | |
| This repository contains the weights of NiRNE, the image-to-normal estimator of Hi3DGen | |
| ## Usage | |
| See the Github repository: https://github.com/lzt02/NiRNE regarding installation instructions. | |
| The model can then be used as follows: | |
| ```python | |
| import torch | |
| from PIL import Image | |
| # Load an image | |
| input_image = Image.open("path/to/your/image.jpg") | |
| # Create predictor instance | |
| predictor = torch.hub.load("lzt02/NiRNE", "NiRNE", trust_repo=True) | |
| # Generate normal map using alpha channel for masking | |
| normal_map = predictor(rgba_image, data_type="object") # Will mask out background, if alpha channel is avalible, else use birefnet | |
| # Apply the model to the image | |
| normal_image = predictor(input_image) | |
| # Save or display the result | |
| normal_image.save("output/normal_map.png") | |
| ``` |