Instructions to use chestnutlzj/Edit-R1-FLUX.1-Kontext-dev with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use chestnutlzj/Edit-R1-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("chestnutlzj/Edit-R1-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
| { | |
| "alpha_pattern": {}, | |
| "auto_mapping": { | |
| "base_model_class": "FluxTransformer2DModel", | |
| "parent_library": "diffusers.models.transformers.transformer_flux" | |
| }, | |
| "base_model_name_or_path": null, | |
| "bias": "none", | |
| "corda_config": null, | |
| "eva_config": null, | |
| "exclude_modules": null, | |
| "fan_in_fan_out": false, | |
| "inference_mode": true, | |
| "init_lora_weights": "gaussian", | |
| "layer_replication": null, | |
| "layers_pattern": null, | |
| "layers_to_transform": null, | |
| "loftq_config": {}, | |
| "lora_alpha": 64, | |
| "lora_bias": false, | |
| "lora_dropout": 0.0, | |
| "megatron_config": null, | |
| "megatron_core": "megatron.core", | |
| "modules_to_save": null, | |
| "peft_type": "LORA", | |
| "qalora_group_size": 16, | |
| "r": 32, | |
| "rank_pattern": {}, | |
| "revision": null, | |
| "target_modules": [ | |
| "attn.add_q_proj", | |
| "attn.to_out.0", | |
| "attn.to_add_out", | |
| "attn.to_v", | |
| "attn.add_v_proj", | |
| "attn.to_k", | |
| "attn.add_k_proj", | |
| "attn.to_q" | |
| ], | |
| "target_parameters": null, | |
| "task_type": null, | |
| "trainable_token_indices": null, | |
| "use_dora": false, | |
| "use_qalora": false, | |
| "use_rslora": false | |
| } |