Update README.md
Browse files
README.md
CHANGED
|
@@ -5,17 +5,16 @@ library_name: diffusers
|
|
| 5 |
test under this PR https://github.com/huggingface/diffusers/pull/11235
|
| 6 |
|
| 7 |
```python
|
| 8 |
-
from diffusers.modular_pipelines import
|
| 9 |
import torch
|
| 10 |
from diffusers.utils import load_image
|
| 11 |
|
| 12 |
repo_id = "YiYiXu/modular-diffdiff"
|
| 13 |
|
| 14 |
-
diffdiff_blocks = ModularPipelineMixin.from_pretrained(repo_id, trust_remote_code=True)
|
| 15 |
components = ComponentsManager()
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
components.enable_auto_cpu_offload()
|
| 21 |
|
|
@@ -27,7 +26,7 @@ mask = load_image("https://huggingface.co/datasets/OzzyGT/testing-resources/reso
|
|
| 27 |
prompt = "a green pear"
|
| 28 |
negative_prompt = "blurry"
|
| 29 |
|
| 30 |
-
image =
|
| 31 |
prompt=prompt,
|
| 32 |
negative_prompt=negative_prompt,
|
| 33 |
num_inference_steps=25,
|
|
@@ -36,7 +35,7 @@ image = diffdiff_blocks.run(
|
|
| 36 |
output="images"
|
| 37 |
)[0]
|
| 38 |
|
| 39 |
-
image.save("
|
| 40 |
```
|
| 41 |
|
| 42 |
|
|
|
|
| 5 |
test under this PR https://github.com/huggingface/diffusers/pull/11235
|
| 6 |
|
| 7 |
```python
|
| 8 |
+
from diffusers.modular_pipelines import ModularPipeline, ComponentsManager
|
| 9 |
import torch
|
| 10 |
from diffusers.utils import load_image
|
| 11 |
|
| 12 |
repo_id = "YiYiXu/modular-diffdiff"
|
| 13 |
|
|
|
|
| 14 |
components = ComponentsManager()
|
| 15 |
|
| 16 |
+
diffdiff_pipeline = ModularPipeline.from_pretrained(repo_id, trust_remote_code=True, component_manager=components, collection="diffdiff")
|
| 17 |
+
diffdiff_pipeline.loader.load(torch_dtype=torch.float16)
|
| 18 |
|
| 19 |
components.enable_auto_cpu_offload()
|
| 20 |
|
|
|
|
| 26 |
prompt = "a green pear"
|
| 27 |
negative_prompt = "blurry"
|
| 28 |
|
| 29 |
+
image = diffdiff_pipeline(
|
| 30 |
prompt=prompt,
|
| 31 |
negative_prompt=negative_prompt,
|
| 32 |
num_inference_steps=25,
|
|
|
|
| 35 |
output="images"
|
| 36 |
)[0]
|
| 37 |
|
| 38 |
+
image.save("yiyi_test_modular_remote_diffdiff_out.png")
|
| 39 |
```
|
| 40 |
|
| 41 |
|