CogView4Transformer2DModel¶
A Diffusion Transformer model for 2D data from CogView4
The model can be loaded with the following code snippet.
from mindone.diffusers import CogView4Transformer2DModel
transformer = CogView4Transformer2DModel.from_pretrained("THUDM/CogView4-6B", subfolder="transformer", mindspore_dtype=ms.bfloat16)
mindone.diffusers.models.transformers.CogView4Transformer2DModel
¶
Bases: ModelMixin
, ConfigMixin
PARAMETER | DESCRIPTION |
---|---|
patch_size |
The size of the patches to use in the patch embedding layer.
TYPE:
|
in_channels |
The number of channels in the input.
TYPE:
|
num_layers |
The number of layers of Transformer blocks to use.
TYPE:
|
attention_head_dim |
The number of channels in each head.
TYPE:
|
num_attention_heads |
The number of heads to use for multi-head attention.
TYPE:
|
out_channels |
The number of channels in the output.
TYPE:
|
text_embed_dim |
Input dimension of text embeddings from the text encoder.
TYPE:
|
time_embed_dim |
Output dimension of timestep embeddings.
TYPE:
|
condition_dim |
The embedding dimension of the input SDXL-style resolution conditions (original_size, target_size, crop_coords).
TYPE:
|
pos_embed_max_size |
The maximum resolution of the positional embeddings, from which slices of shape
TYPE:
|
sample_size |
The base resolution of input latents. If height/width is not provided during generation, this value is used
to determine the resolution as
TYPE:
|
Source code in mindone/diffusers/models/transformers/transformer_cogview4.py
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 |
|
mindone.diffusers.models.modeling_outputs.Transformer2DModelOutput
dataclass
¶
Bases: BaseOutput
The output of [Transformer2DModel
].
PARAMETER | DESCRIPTION |
---|---|
`(batch |
The hidden states output conditioned on the
TYPE:
|
Source code in mindone/diffusers/models/modeling_outputs.py
22 23 24 25 26 27 28 29 30 31 32 33 34 |
|