Instructions to use mingyi456/LongCat-Image-Edit-DF11 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use mingyi456/LongCat-Image-Edit-DF11 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("mingyi456/LongCat-Image-Edit-DF11", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Diffusion Single File
How to use mingyi456/LongCat-Image-Edit-DF11 with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Update README.md
#1
by zye2 - opened
README.md
CHANGED
|
@@ -22,7 +22,13 @@ Feel free to request for other models for compression as well (for either the `d
|
|
| 22 |
```python
|
| 23 |
import torch
|
| 24 |
from diffusers import LongCatImageEditPipeline, LongCatImageTransformer2DModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
from transformers.modeling_utils import no_init_weights
|
|
|
|
| 26 |
with no_init_weights():
|
| 27 |
transformer = LongCatImageTransformer2DModel.from_config(
|
| 28 |
LongCatImageTransformer2DModel.load_config(
|
|
|
|
| 22 |
```python
|
| 23 |
import torch
|
| 24 |
from diffusers import LongCatImageEditPipeline, LongCatImageTransformer2DModel
|
| 25 |
+
|
| 26 |
+
# for transformers version >=5.0.0
|
| 27 |
+
# from transformers.initialization import no_init_weights
|
| 28 |
+
|
| 29 |
+
# else
|
| 30 |
from transformers.modeling_utils import no_init_weights
|
| 31 |
+
|
| 32 |
with no_init_weights():
|
| 33 |
transformer = LongCatImageTransformer2DModel.from_config(
|
| 34 |
LongCatImageTransformer2DModel.load_config(
|