You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7f00a08
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: projects/blip-diffusion/README.md
+81Lines changed: 81 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,87 @@ pip install -e .
31
31
-**Virtual Try-On via Subject-driven Editing**:
32
32
- the model can be used to naturally facilitate virtual try-on. We provide an zero-shot example: [notebook](https://github.com/salesforce/LAVIS/blob/main/projects/blip-diffusion/notebooks/editing_tryon_zeroshot.ipynb), [](https://colab.research.google.com/github/salesforce/LAVIS/blob/main/projects/blip-diffusion/notebooks/editing_tryon_zeroshot.ipynb);
33
33
34
+
### **🧨 Diffusers Support**
35
+
BLIP-Diffusion is now supported in 🧨[Diffusers](https://huggingface.co/docs/diffusers/main/en/api/pipelines/blip_diffusion).
36
+
- Example on subject-driven generation:
37
+
```python
38
+
from diffusers.pipelines import BlipDiffusionPipeline
negative_prompt ="over-exposure, under-exposure, saturated, duplicate, out of frame, lowres, cropped, worst quality, low quality, jpeg artifacts, morbid, mutilated, out of frame, ugly, bad anatomy, bad proportions, deformed, blurry, duplicate"
57
+
58
+
59
+
output = blip_diffusion_pipe(
60
+
text_prompt_input,
61
+
cond_image,
62
+
cond_subject,
63
+
tgt_subject,
64
+
guidance_scale=guidance_scale,
65
+
num_inference_steps=num_inference_steps,
66
+
neg_prompt=negative_prompt,
67
+
height=512,
68
+
width=512,
69
+
).images
70
+
output[0].save("image.png")
71
+
```
72
+
- Example on subject-driven stylization
73
+
```python
74
+
from diffusers.pipelines import BlipDiffusionControlNetPipeline
negative_prompt ="over-exposure, under-exposure, saturated, duplicate, out of frame, lowres, cropped, worst quality, low quality, jpeg artifacts, morbid, mutilated, out of frame, ugly, bad anatomy, bad proportions, deformed, blurry, duplicate"
98
+
99
+
100
+
output = blip_diffusion_pipe(
101
+
text_prompt,
102
+
style_image,
103
+
cldm_cond_image,
104
+
style_subject,
105
+
tgt_subject,
106
+
guidance_scale=guidance_scale,
107
+
num_inference_steps=num_inference_steps,
108
+
neg_prompt=negative_prompt,
109
+
height=512,
110
+
width=512,
111
+
).images
112
+
output[0].save("image.png")
113
+
```
114
+
34
115
35
116
### Cite BLIP-Diffusion
36
117
If you find our work helpful, please consider citing:
0 commit comments