Instructions to use nunchaku-ai/nunchaku-flux.1-kontext-dev with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use nunchaku-ai/nunchaku-flux.1-kontext-dev 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("nunchaku-ai/nunchaku-flux.1-kontext-dev", 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
help
#1
by adana1244 - opened
Hello,
I am trying to load the model "nunchaku-tech/nunchaku-flux.1-kontext-dev" using the diffusers library within a Google Colab environment, but I am encountering a 404 Client Error: Not Found.
The exact error message I receive is:EntryNotFoundError: 404 Client Error. (...)
Entry Not Found for url: [redacted link].
My code in the Colab notebook is as follows:
from diffusers import DiffusionPipeline
from diffusers.utils import load_image
pipe = DiffusionPipeline.from_pretrained("nunchaku-tech/nunchaku-flux.1-kontext-dev")
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]
I have confirmed the model ID is correct based on the Hugging Face page URL. I have also attempted authentication with a Hugging Face token in my Colab environment, but the error persists. The error message suggests that the model_index.json file, which DiffusionPipeline.from_pretrained seems to look for, is not found at the expected location within the repository.
Could you please provide guidance on how to properly load and use this model with the diffusers library in a Colab environment? I am looking for a solution to resolve this loading error.
Thank you for your help!