Upload black-forest-labs_FLUX.1-Kontext-dev_1.py with huggingface_hub
Browse files3 unmodified lines4567899 unmodified lines1920212223242526272813 unmodified lines424344454647484950513 unmodified lines# "numpy",# "einops",# "pandas",# "protobuf",# "torch",# "sentencepiece",9 unmodified lines# ///try:from diffusers import DiffusionPipelinefrom diffusers.utils import load_imagepipe = DiffusionPipeline.from_pretrained("black-forest-labs/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")13 unmodified lineswith open('black-forest-labs_FLUX.1-Kontext-dev_1.txt', 'a', encoding='utf-8') as f:import tracebackf.write('''```CODE:from diffusers import DiffusionPipelinefrom diffusers.utils import load_imagepipe = DiffusionPipeline.from_pretrained("black-forest-labs/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")3 unmodified lines45678910119 unmodified lines21222324252627282930313213 unmodified lines4647484950515253545556573 unmodified lines# "numpy",# "einops",# "pandas",# "matplotlib",# "paddleorc",# "protobuf",# "torch",# "sentencepiece",9 unmodified lines# ///try:import torchfrom diffusers import DiffusionPipelinefrom diffusers.utils import load_image# switch to "mps" for apple devicespipe = DiffusionPipeline.from_pretrained("black-forest-labs/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")13 unmodified lineswith open('black-forest-labs_FLUX.1-Kontext-dev_1.txt', 'a', encoding='utf-8') as f:import tracebackf.write('''```CODE:import torchfrom diffusers import DiffusionPipelinefrom diffusers.utils import load_image# switch to "mps" for apple devicespipe = DiffusionPipeline.from_pretrained("black-forest-labs/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")
black-forest-labs_FLUX.1-Kontext-dev_1.py+8-2