Instructions to use alex4727/InstantDrag with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use alex4727/InstantDrag 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("alex4727/InstantDrag", 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
| { | |
| "_name_or_path": "/root/data2/huggingface_ckpts/hub/models--runwayml--stable-diffusion-v1-5/snapshots/1d0c4ebf6ff58a5caecab40fa1406526bca4b5b9/safety_checker", | |
| "architectures": [ | |
| "StableDiffusionSafetyChecker" | |
| ], | |
| "initializer_factor": 1.0, | |
| "logit_scale_init_value": 2.6592, | |
| "model_type": "clip", | |
| "projection_dim": 768, | |
| "text_config": { | |
| "dropout": 0.0, | |
| "hidden_size": 768, | |
| "intermediate_size": 3072, | |
| "model_type": "clip_text_model", | |
| "num_attention_heads": 12 | |
| }, | |
| "torch_dtype": "float32", | |
| "transformers_version": "4.39.3", | |
| "vision_config": { | |
| "dropout": 0.0, | |
| "hidden_size": 1024, | |
| "intermediate_size": 4096, | |
| "model_type": "clip_vision_model", | |
| "num_attention_heads": 16, | |
| "num_hidden_layers": 24, | |
| "patch_size": 14 | |
| } | |
| } | |