Instructions to use ByteDance/Bernini-Diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ByteDance/Bernini-Diffusers with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("ByteDance/Bernini-Diffusers", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Add files using upload-large-folder tool
Browse files- config.json +59 -0
config.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "bernini",
|
| 3 |
+
"architectures": ["BerniniModel"],
|
| 4 |
+
"mllm_attn_implementation": "sdpa",
|
| 5 |
+
"partial_pretrain_model": "",
|
| 6 |
+
"diff_dec_config_path": "./pretrained_models/Bernini-Diffusers",
|
| 7 |
+
"transformer_config_path": "./pretrained_models/Bernini-Diffusers/transformer_config.json",
|
| 8 |
+
"transformer_2_config_path": "./pretrained_models/Bernini-Diffusers/transformer_2_config.json",
|
| 9 |
+
"wan22_base": "./pretrained_models/Bernini-Diffusers",
|
| 10 |
+
"vae_model_path": "./pretrained_models/Bernini-Diffusers",
|
| 11 |
+
"vae_subfolder": "vae",
|
| 12 |
+
"vae_config_path": "./pretrained_models/Bernini-Diffusers/vae/config.json",
|
| 13 |
+
"cotrain": true,
|
| 14 |
+
"boundary_ratio": 0.417,
|
| 15 |
+
"switch_dit_boundary": 0.875,
|
| 16 |
+
"shift": 3.0,
|
| 17 |
+
"logit_mean": 0.5,
|
| 18 |
+
"logit_std": 1,
|
| 19 |
+
"mode_scale": 1.29,
|
| 20 |
+
"scratch": true,
|
| 21 |
+
"transformers_version": "4.57.3",
|
| 22 |
+
"mllm_config_path": "./pretrained_models/Bernini-Diffusers",
|
| 23 |
+
"mllm_subfolder": "mllm",
|
| 24 |
+
"processor_config_path": "./pretrained_models/Bernini-Diffusers",
|
| 25 |
+
"processor_subfolder": "mllm",
|
| 26 |
+
"bernini_ckpt_subfolder": "bernini",
|
| 27 |
+
"scratch_mllm": true,
|
| 28 |
+
"use_src_id_rotary_emb": true,
|
| 29 |
+
"feature_type_from_stage_one": "masked_tgt_embed_with_qwen_txt_vit_tokens",
|
| 30 |
+
"num_mask_token": 4096,
|
| 31 |
+
"max_sequence_length": 512,
|
| 32 |
+
"clip_diff_cfg": {
|
| 33 |
+
"model_type": "flow_match",
|
| 34 |
+
"z_channels": 3584,
|
| 35 |
+
"target_channels": 3584,
|
| 36 |
+
"width": 4096,
|
| 37 |
+
"diffusion_batch_mul": 16,
|
| 38 |
+
"shift": 2.0
|
| 39 |
+
},
|
| 40 |
+
"connector_cfg": {
|
| 41 |
+
"model_type": "QwenConnector",
|
| 42 |
+
"out_dim_for_gen": 4096,
|
| 43 |
+
"enable_gen_branch": true,
|
| 44 |
+
"out_dim_for_vit": 3584,
|
| 45 |
+
"enable_vit_branch": true,
|
| 46 |
+
"gen_head_type": "zerolinear",
|
| 47 |
+
"zero_init_proj_gen_last": true
|
| 48 |
+
},
|
| 49 |
+
"mask_ratio_infer_cfg": {
|
| 50 |
+
"generator_type": "default"
|
| 51 |
+
},
|
| 52 |
+
"t5_max_sequence_length": 512,
|
| 53 |
+
"t5_text_encoder_path": "./pretrained_models/Bernini-Diffusers",
|
| 54 |
+
"t5_text_encoder_subfolder": "t5_text_encoder",
|
| 55 |
+
"t5_tokenizer_path": "./pretrained_models/Bernini-Diffusers",
|
| 56 |
+
"t5_tokenizer_subfolder": "t5_tokenizer",
|
| 57 |
+
"t5_combine_type": "concat_with_zero_init",
|
| 58 |
+
"target_fps": 16
|
| 59 |
+
}
|