|
--- |
|
license: other |
|
license_name: stabilityai-ai-community |
|
license_link: LICENSE.md |
|
language: |
|
- en |
|
base_model: |
|
- tensorart/bokeh_3.5_medium |
|
pipeline_tag: text-to-image |
|
--- |
|
|
|
<div align="center"> |
|
|
|
**Bokeh_Depth_Controlnet** |
|
|
|
<img src="show.jpg"/> |
|
</div> |
|
|
|
## Description |
|
|
|
- Input Image: Depth information map generated by depth estimation model |
|
- Output Image: Base model integrates depth information for control, generating more realistic depth-of-field effects and spatial structure control. |
|
|
|
The depth map enables the model to better understand spatial relationships within images, achieving more precise depth-of-field control and three-dimensional effect generation. |
|
|
|
## Example |
|
| input | output | Prompt | |
|
|:---:|:---:|:---| |
|
| <img src="./images/001_depth.png" width="300"/> | <img src="./images/001.png" width="300"/> | a old man | |
|
| <img src="./images/002_depth.png" width="300"/> | <img src="./images/002.png" width="300"/> | A lone astronaut in a white suit and helmet, with a backpack, strolls on a rocky, red landscape under a star galaxy | |
|
| <img src="./images/003_depth.png" width="300"/> | <img src="./images/003.png" width="300"/> | a eagle , black background | |
|
| <img src="./images/004_depth.png" width="300"/> | <img src="./images/004.png" width="300"/> | A crystal heart sits on a gnarly, moss-covered log, with a galaxy background | |
|
|
|
## Use |
|
We recommend using ComfyUI for local inference |
|
 |
|
|
|
# With Bokeh |
|
```python |
|
import torch |
|
from diffusers import StableDiffusion3ControlNetPipeline |
|
from diffusers import SD3ControlNetModel |
|
from diffusers.utils import load_image |
|
|
|
controlnet = SD3ControlNetModel.from_pretrained("tensorart/Bokeh_Depth_Controlnet") |
|
pipe = StableDiffusion3ControlNetPipeline.from_pretrained( |
|
"tensorart/bokeh_3.5_medium", |
|
controlnet=controlnet |
|
) |
|
pipe.to("cuda", torch.float16) |
|
|
|
control_image = load_image("https://huggingface.co/tensorart/Bokeh_Depth_Controlnet/resolve/main/images/001_depth.png") |
|
prompt = "A old man talking" |
|
negative_prompt ="anime,render,cartoon,3d,bad hands,extra finger" |
|
negative_prompt_3="" |
|
|
|
image = pipe( |
|
prompt, |
|
num_inference_steps=28, |
|
negative_prompt=negative_prompt, |
|
negative_prompt_3=negative_prompt_3, |
|
control_image=control_image, |
|
height=1440, |
|
width=1440, |
|
guidance_scale=4, |
|
controlnet_conditioning_scale=0.85 |
|
).images[0] |
|
image.save('image.jpg') |
|
``` |
|
|
|
## Contact |
|
* Website: https://tensor.art https://tusiart.com |
|
* Developed by: TensorArt |
|
* Api: https://tams.tensor.art/ |