Buckets:
| # | |
| # مرخّص بموجب ترخيص Apache الإصدار 2.0 (المسمى "الترخيص") | |
| # لا يجوز لك استخدام هذا الملف إلا وفقاً لشروط الترخيص. | |
| # يمكنك الحصول على نسخة من الترخيص في | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # ما لم يقتضِ ذلك القانون المعمول به أو ما اتُّفق عليه كتابياً، البرمجيات | |
| # تُوزَّع بموجب الرخصة على أساس "كما هي"، | |
| # بلا أي ضمانات أو شروط من أي نوع، سواء صريحة أو ضمنية. | |
| # راجع الترخيص لمعرفة اللغة المحددة التي تحكم الصلاحيات و | |
| # قيود بموجب الترخيص. --> | |
| # Anima | |
| Anima هو نموذج لتحويل النص إلى صورة يعيد استخدام [CosmosTransformer3DModel](/docs/diffusers/main/ar/api/models/cosmos_transformer3d#diffusers.CosmosTransformer3DModel) مع مشفر نصي Qwen3، ومشروط نصي T5-token، ووحدة الترميز/فك الترميز [AutoencoderKLQwenImage](/docs/diffusers/main/ar/api/models/autoencoderkl_qwenimage#diffusers.AutoencoderKLQwenImage). | |
| ```python | |
| import torch | |
| from diffusers import ModularPipeline | |
| pipe = ModularPipeline.from_pretrained("circlestone-labs/Anima-Base-v1.0-Diffusers") | |
| pipe.load_components(dtype=torch.bfloat16) | |
| pipe.to("cuda") # or "mps", "xpu", "cpu" | |
| image = pipe(prompt="masterpiece, best quality, 1girl, solo, city lights").images[0] | |
| ``` | |
| ## AnimaModularPipeline[[diffusers.AnimaModularPipeline]] | |
| #### diffusers.AnimaModularPipeline[[diffusers.AnimaModularPipeline]] | |
| ```python | |
| diffusers.AnimaModularPipeline(blocks: diffusers.modular_pipelines.modular_pipeline.ModularPipelineBlocks | None = None, pretrained_model_name_or_path: str | os.PathLike | None = None, components_manager: diffusers.modular_pipelines.components_manager.ComponentsManager | None = None, collection: str | None = None, workflow: str | None = None, modular_config_dict: dict[str, typing.Any] | None = None, config_dict: dict[str, typing.Any] | None = None, **kwargs) | |
| ``` | |
| [المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/anima/modular_pipeline.py#L19) | |
| ModularPipeline لـ Anima. | |
| ## AnimaAutoBlocks[[diffusers.AnimaAutoBlocks]] | |
| #### diffusers.AnimaAutoBlocks[[diffusers.AnimaAutoBlocks]] | |
| ```python | |
| diffusers.AnimaAutoBlocks() | |
| ``` | |
| [المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/anima/modular_blocks_anima.py#L312) | |
| خط أنابيب Auto Modular لتوليد الصور من النص وتحويل الصور إلى صور باستخدام Anima. | |
| سير العمل المدعومة: | |
| - `text2image`: يتطلب `prompt` | |
| - `img2img`: يتطلب `image`، `prompt` | |
| المكوّنات: text_encoder (`Qwen3Model`) tokenizer (`Qwen2Tokenizer`) t5_tokenizer (`T5Tokenizer`) guider (`ClassifierFreeGuidance`) vae (`AutoencoderKLQwenImage`) image_processor (`VaeImageProcessor`) text_conditioner (`AnimaTextConditioner`) transformer (`CosmosTransformer3DModel`) scheduler (`FlowMatchEulerDiscreteScheduler`) | |
| المدخلات: prompt (`str`): الأمر أو الأوامر التي تُوجّه توليد الصورة. negative_prompt (`str`, *اختياري*): الأمر أو الأوامر التي لا تُوجّه توليد الصورة. max_sequence_length (`int`, *اختياري*, الافتراضي 512): الحد الأقصى لطول التسلسل لتشفير الأمر. image (`Image | list`, *اختياري*): صورة أو صور مرجعية لإزالة الضوضاء. يمكن أن تكون صورة واحدة أو قائمة من الصور. height (`int`, *اختياري*): ارتفاع الصورة المولّدة بالبكسل. width (`int`, *اختياري*): عرض الصورة المولّدة بالبكسل. generator (`Generator`, *اختياري*): مولّد Torch لتوليد حتمي. num_images_per_prompt (`int`, *اختياري*, الافتراضي 1): عدد الصور التي سيتم توليدها لكل أمر. image_latents (`Tensor`, *اختياري*): كامنات الصور المستخدمة لتوجيه توليد الصورة. يمكن توليدها من خطوة vae_encoder. num_inference_steps (`int`): عدد خطوات إزالة الضوضاء. sigmas (`list`, *اختياري*): قيم sigmas مخصصة لعملية إزالة الضوضاء. strength (`float`, *اختياري*, الافتراضي 0.9): قوة img2img/التلوين. latents (`Tensor`): كامنات ضوضائية مولّدة مسبقًا لتوليد الصورة. **denoiser_input_fields (`None`, *اختياري*): مدخلات النموذج الشرطي لمزيل ضوضاء Anima. output_type (`str`, *اختياري*, الافتراضي pil): صيغة الإخراج: 'pil'، 'np'، 'pt'. | |
| المخرجات: صور (`list`): الصور المولّدة. | |
| ## AnimaTextConditioner[[diffusers.AnimaTextConditioner]] | |
| #### diffusers.AnimaTextConditioner[[diffusers.AnimaTextConditioner]] | |
| ```python | |
| diffusers.AnimaTextConditioner(source_dim: int = 1024, target_dim: int = 1024, model_dim: int = 1024, num_layers: int = 6, num_attention_heads: int = 16, mlp_ratio: float = 4.0, target_vocab_size: int = 32128, use_self_attention: bool = True, use_layer_norm: bool = False, min_sequence_length: int = 512) | |
| ``` | |
| [المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/condition_embedders/condition_embedder_anima.py#L229) | |
| مُعدِّل النص المستخدم في Anima لتحويل الحالات المخفية لـ Qwen3 ومعرفات الرموز لـ T5 إلى تمثيلات نصية لـ Cosmos. | |
| يعيد Anima استخدام Cosmos Predict2 DiT. الوحدة الشرطية الوحيدة الخاصة بالنموذج هي هذا المحوّل LLM، الذي يقوم بالانتباه المتقاطع من تضمينات رموز T5 المتعلمة إلى حالات المخفية لمشفّر النص Qwen3 قبل حلقة الانتشار. `target_dim` هو بُعد مخرج المُشَرِّط ويجب أن يطابق `text_embed_dim` الخاص بالمحوّل. | |
| #### forward[[diffusers.AnimaTextConditioner.forward]] | |
| ```python | |
| forward(source_hidden_states: Tensor, target_input_ids: Tensor, target_attention_mask: typing.Optional[torch.Tensor] = None, source_attention_mask: typing.Optional[torch.Tensor] = None) | |
| ``` | |
| [المصدر](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/condition_embedders/condition_embedder_anima.py#L285) | |
| **المعاملات:** | |
| source_hidden_states (`torch.Tensor` من الشكل `(batch_size, source_sequence_length, source_dim)`) : حالات المخفية لمشفّر النص في Qwen3 التي يُشترط عليها. | |
| target_input_ids (`torch.Tensor` من الشكل `(batch_size, target_sequence_length)`) : معرّفات رموز T5 المستخدمة كرموز استعلام متعلّمة. | |
| target_attention_mask (`torch.Tensor`، *اختياري*) : قناع الانتباه لمعرّفات رموز T5 المستهدفة. | |
| source_attention_mask (`torch.Tensor`، *اختياري*) : قناع الانتباه لحالات Qwen3 المخفية للمصدر. | |
| **يعيد:** `torch.Tensor` | |
| تضمينات تكييف النص لمحوّل Cosmos. | |
Xet Storage Details
- Size:
- 7.4 kB
- Xet hash:
- 10d08908d33c9ae9bd3d6b2e0e688243fffea6fbdab56dd6375e42415ab7365d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.