| --- |
| license: bsd |
| --- |
| |
| # InteractDiffusion Diffuser Implementation |
|
|
| ## How to Use |
|
|
| ```python |
| from diffusers import DiffusionPipeline |
| import torch |
| |
| pipeline = DiffusionPipeline.from_pretrained( |
| "interactdiffusion/diffusers-v1-2", |
| trust_remote_code=True, |
| variant="fp16", torch_dtype=torch.float16 |
| ) |
| pipeline = pipeline.to("cuda") |
| |
| images = pipeline( |
| prompt="a person is feeding a cat", |
| interactdiffusion_subject_phrases=["person"], |
| interactdiffusion_object_phrases=["cat"], |
| interactdiffusion_action_phrases=["feeding"], |
| interactdiffusion_subject_boxes=[[0.0332, 0.1660, 0.3359, 0.7305]], |
| interactdiffusion_object_boxes=[[0.2891, 0.4766, 0.6680, 0.7930]], |
| interactdiffusion_scheduled_sampling_beta=1, |
| output_type="pil", |
| num_inference_steps=50, |
| ).images |
| |
| images[0].save('out.jpg') |
| ``` |
|
|
| For more information, please check the project homepage: |
|
|