Buckets:
| # Bria 3.2 | |
| Bria 3.2, bir sonraki nesil ticari kullanıma hazır metinden görüntüye modelidir. Sadece 4 milyar parametreye sahip olmasına rağmen istisnai estetik ve metin işleme özellikleri sunar; önde gelen açık kaynak modellerle karşılaştırıldığında benzer sonuçlar verdiği değerlendirilmiş ve diğer lisanslı modelleri geride bırakmıştır. Tamamen lisanslı veriler üzerinde inşa edilmesinin yanı sıra 3.2, kurumsal ve ticari kullanım için çeşitli avantajlar sunar: | |
| - Verimli Hesaplama - model, piyasadaki eşdeğer modellerden X3 kat daha küçük (diğer açık kaynak modellerde 12B parametreye karşılık 4B parametre) | |
| - Mimari Tutarlılığı: 3.1 ile aynı mimari—kesinti olmadan yükseltme yapmak isteyen kullanıcılar için idealdir. | |
| - İnce Ayar Hızlandırması: L40S ve A100 üzerinde 2 kat daha hızlı ince ayar. | |
| Bria 3.2'nin orijinal model denetim noktaları [burada](https://huggingface.co/briaai/BRIA-3.2) bulunabilir. Bria 3.2'nin Github deposu [burada](https://github.com/Bria-AI/BRIA-3.2) bulunabilir. | |
| Bria platformu hakkında daha fazla bilgi edinmek ve ücretsiz traril erişimi almak istiyorsanız, lütfen [bria.ai](https://bria.ai) adresini ziyaret edin. | |
| ## Kullanım | |
| _Model kapılı (gated) olduğu için, diffusers ile kullanmadan önce [Bria 3.2 Hugging Face sayfasına](https://huggingface.co/briaai/BRIA-3.2) gidip formu doldurmanız ve kapıyı kabul etmeniz gerekir. Kabul ettikten sonra, sisteminizin kapıyı kabul ettiğinizi bilmesi için oturum açmanız gerekir._ | |
| Giriş yapmak için aşağıdaki komutu kullanın: | |
| ```bash | |
| hf auth login | |
| ``` | |
| ## BriaPipeline[[diffusers.BriaPipeline]] | |
| #### diffusers.BriaPipeline[[diffusers.BriaPipeline]] | |
| ```python | |
| diffusers.BriaPipeline(transformer: BriaTransformer2DModel, scheduler: diffusers.schedulers.scheduling_flow_match_euler_discrete.FlowMatchEulerDiscreteScheduler | diffusers.schedulers.scheduling_utils.KarrasDiffusionSchedulers, vae: AutoencoderKL, text_encoder: T5EncoderModel, tokenizer: T5Tokenizer, image_encoder: CLIPVisionModelWithProjection = None, feature_extractor: CLIPImageProcessorPil = None) | |
| ``` | |
| [Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/bria/pipeline_bria.py#L89) | |
| **Parametreler:** | |
| transformer ([BriaTransformer2DModel](/docs/diffusers/main/tr/api/models/bria_transformer#diffusers.BriaTransformer2DModel)) : Kodlanmış görüntü latentlerini gürültüden arındırmak için kullanılan Koşullu Transformer (MMDiT) mimarisi. | |
| scheduler ([FlowMatchEulerDiscreteScheduler](/docs/diffusers/main/tr/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler)) : Kodlanmış görüntü latentlerini gürültüden arındırmak için `transformer` ile birlikte kullanılacak bir zamanlayıcı. | |
| vae ([AutoencoderKL](/docs/diffusers/main/tr/api/models/autoencoderkl#diffusers.AutoencoderKL)) : Görüntüleri gizil (latent) temsillere kodlamak ve bu temsillerden görüntülere çözmek için kullanılan Varyasyonel Oto-Kodlayıcı (VAE) Modeli. | |
| text_encoder (`T5EncoderModel`) : Donmuş metin kodlayıcı. Bria, [T5](https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5EncoderModel)'i, özellikle de [t5-v1_1-xxl](https://huggingface.co/google/t5-v1_1-xxl) varyantını kullanır. | |
| tokenizer (`T5TokenizerFast`) : [T5Tokenizer](https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5Tokenizer) sınıfının tokenizer'ı. | |
| Birkaç değişiklik içeren FluxPipeline tabanlı: | |
| - birleştirilmiş gömme yok | |
| - İstemler için sıfır dolgusu kullanıyoruz | |
| - Bu, damıtılmış bir sürüm olmadığı için yönlendirme gömme (guidance embedding) yoktur | |
| #### __call__[[diffusers.BriaPipeline.__call__]] | |
| ```python | |
| __call__(prompt: str | list[str] = None, height: int | None = None, width: int | None = None, num_inference_steps: int = 30, timesteps: list = None, guidance_scale: float = 5, negative_prompt: str | list[str] | None = None, num_images_per_prompt: int | None = 1, generator: typing.Union[torch.Generator, list[torch.Generator], NoneType] = None, latents: typing.Optional[torch.FloatTensor] = None, prompt_embeds: typing.Optional[torch.FloatTensor] = None, negative_prompt_embeds: typing.Optional[torch.FloatTensor] = None, output_type: str | None = 'pil', return_dict: bool = True, attention_kwargs: dict[str, typing.Any] | None = None, callback_on_step_end: typing.Optional[typing.Callable[[int, int], NoneType]] = None, callback_on_step_end_tensor_inputs: list = ['latents'], max_sequence_length: int = 128, clip_value: None | float = None, normalize: bool = False) | |
| ``` | |
| [Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/bria/pipeline_bria.py#L448) | |
| **Parametreler:** | |
| prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmek için istem veya istemler. Tanımlanmamışsa, bunun yerine `prompt_embeds` geçirilmelidir. | |
| height (`int`, *isteğe bağlı*, varsayılan olarak self.unet.config.sample_size * self.vae_scale_factor) : Üretilen görüntünün piksel cinsinden yüksekliği. En iyi sonuçlar için varsayılan olarak 1024 olarak ayarlanır. | |
| width (`int`, *isteğe bağlı*, varsayılan olarak self.unet.config.sample_size * self.vae_scale_factor) : Üretilen görüntünün piksel cinsinden genişliği. En iyi sonuçlar için varsayılan olarak 1024 olarak ayarlanır. | |
| num_inference_steps (`int`, *isteğe bağlı*, varsayılan 50) : Gürültü azaltma adım sayısı. Daha fazla gürültü azaltma adımı genellikle daha yavaş çıkarım pahasına daha yüksek kaliteli bir görüntüye yol açar. | |
| timesteps (`list[int]`, *isteğe bağlı*) : `set_timesteps` metodunda `timesteps` argümanını destekleyen zamanlayıcılarla gürültü azaltma süreci için kullanılacak özel zaman adımları. Tanımlanmamışsa, `num_inference_steps` geçirildiğinde varsayılan davranış kullanılacaktır. Azalan sırada olmalıdır. | |
| guidance_scale (`float`, *isteğe bağlı*, varsayılan 5.0) -- | |
| **Dönüş:** `~pipelines.bria.BriaPipelineOutput` veya `tuple` | |
| `return_dict` True ise `~pipelines.bria.BriaPipelineOutput`, aksi halde bir `tuple`. Tuple döndürüldüğünde, ilk öğe üretilen görsellerin listesidir. | |
| Üretim için pipeline çağrıldığında tetiklenen işlev. | |
| <<<<<<< HEAD [Classifier-Free Diffusion Guidance](https://arxiv.org/abs/2207.12598) makalesinde tanımlanan Guidance scale. `guidance_scale`, [Imagen Paper](https://arxiv.org/pdf/2205.11487.pdf) makalesindeki 2. denklemdeki `w` olarak tanımlanır. Guidance scale, `guidance_scale > 1` olarak ayarlanarak etkinleştirilir. Daha yüksek guidance scale, genellikle daha düşük görüntü kalitesi pahasına, metin `prompt` ile yakından ilişkili görüntülerin üretilmesini teşvik eder. negative_prompt (`str` veya `list[str]`, *isteğe bağlı*): ======= [Classifier-Free Diffusion Guidance](https://huggingface.co/papers/2207.12598) makalesinde tanımlanan Guidance scale. `guidance_scale`, [Imagen Paper](https://huggingface.co/papers/2205.11487) makalesindeki 2. denklemdeki `w` olarak tanımlanır. Guidance scale, `guidance_scale > 1` olarak ayarlanarak etkinleştirilir. Daha yüksek guidance scale, genellikle daha düşük görüntü kalitesi pahasına, metin `prompt` ile yakından ilişkili görüntülerin üretilmesini teşvik eder. negative_prompt (`str` veya `list[str]`, *isteğe bağlı*): | |
| >>>>>>> main | |
| The prompt or prompts not to guide the image generation. If not defined, one has to pass `negative_prompt_embeds` instead. Ignored when not using guidance (i.e., ignored if `guidance_scale` is less than `1`). num_images_per_prompt (`int`, *optional*, defaults to 1): The number of images to generate per prompt. generator (`torch.Generator` or `list[torch.Generator]`, *optional*): One or a list of [torch generator(s)](https://pytorch.org/docs/stable/generated/torch.Generator.html) to make generation deterministic. latents (`torch.FloatTensor`, *optional*): Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image generation. Can be used to tweak the same generation with different prompts. If not provided, a latents tensor will be generated by sampling using the supplied random `generator`. prompt_embeds (`torch.FloatTensor`, *optional*): Pre-generated text embeddings. Can be used to easily tweak text inputs, *e.g.* prompt weighting. If not provided, text embeddings will be generated from `prompt` input argument. negative_prompt_embeds (`torch.FloatTensor`, *optional*): Pre-generated negative text embeddings. Can be used to easily tweak text inputs, *e.g.* prompt weighting. If not provided, negative_prompt_embeds will be generated from `negative_prompt` input argument. output_type (`str`, *optional*, defaults to `"pil"`): The output format of the generate image. Choose between [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` or `np.array`. return_dict (`bool`, *optional*, defaults to `True`): Whether or not to return a `~pipelines.bria.BriaPipelineOutput` instead of a plain tuple. attention_kwargs (`dict`, *optional*): A kwargs dictionary that if specified is passed along to the `AttentionProcessor` as defined under `self.processor` in [diffusers.models.attention_processor](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py). callback_on_step_end (`Callable`, *optional*): A function that calls at the end of each denoising steps during the inference. The function is called with the following arguments: `callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)`. `callback_kwargs` will include a list of all tensors as specified by `callback_on_step_end_tensor_inputs`. callback_on_step_end_tensor_inputs (`list`, *optional*): The list of tensor inputs for the `callback_on_step_end` function. The tensors specified in the list will be passed as `callback_kwargs` argument. You will only be able to include variables listed in the `._callback_tensor_inputs` attribute of your pipeline class. max_sequence_length (`int` defaults to 256): Maximum sequence length to use with the `prompt`. clip_value (`float`, *optional*): If set, the predicted noise is clipped to the range `[-clip_value, clip_value]` at each denoising step. normalize (`bool`, *optional*, defaults to `False`): Whether to normalize the predicted noise at each denoising step. | |
| Örnekler: | |
| ```py | |
| >>> import torch | |
| >>> from diffusers import BriaPipeline | |
| >>> pipe = BriaPipeline.from_pretrained("briaai/BRIA-3.2", torch_dtype=torch.bfloat16) | |
| >>> pipe.to("cuda") | |
| # BRIA's T5 text encoder is sensitive to precision. We need to cast it to bfloat16 and keep the final layer in float32. | |
| >>> pipe.text_encoder = pipe.text_encoder.to(dtype=torch.bfloat16) | |
| >>> for block in pipe.text_encoder.encoder.block: | |
| ... block.layer[-1].DenseReluDense.wo.to(dtype=torch.float32) | |
| # BRIA's VAE is not supported in mixed precision, so we use float32. | |
| >>> if pipe.vae.config.shift_factor == 0: | |
| ... pipe.vae.to(dtype=torch.float32) | |
| >>> prompt = "Photorealistic food photography of a stack of fluffy pancakes on a white plate, with maple syrup being poured over them. On top of the pancakes are the words 'BRIA 3.2' in bold, yellow, 3D letters. The background is dark and out of focus." | |
| >>> image = pipe(prompt).images[0] | |
| >>> image.save("bria.png") | |
| ``` | |
| #### encode_prompt[[diffusers.BriaPipeline.encode_prompt]] | |
| ```python | |
| encode_prompt(prompt: str | list[str], device: typing.Optional[torch.device] = None, num_images_per_prompt: int = 1, do_classifier_free_guidance: bool = True, negative_prompt: str | list[str] | None = None, prompt_embeds: typing.Optional[torch.FloatTensor] = None, negative_prompt_embeds: typing.Optional[torch.FloatTensor] = None, max_sequence_length: int = 128, lora_scale: float | None = None) | |
| ``` | |
| [Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/bria/pipeline_bria.py#L146) | |
| **Parametreler:** | |
| prompt (`str` veya `list[str]`, *isteğe bağlı*) : kodlanacak istem | |
| device : (`torch.device`): torch cihazı | |
| num_images_per_prompt (`int`) : her istem için oluşturulacak görsel sayısı | |
| do_classifier_free_guidance (`bool`) : sınıflandırıcı serbest yönlendirmenin (classifier free guidance) kullanılıp kullanılmayacağı | |
| negative_prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmemek için kullanılan istem veya istemler. Tanımlanmazsa, bunun yerine `negative_prompt_embeds` parametresinin geçirilmesi gerekir. Yönlendirme kullanılmadığında (yani `guidance_scale` değeri `1`'den küçükse) yok sayılır. | |
| prompt_embeds (`torch.FloatTensor`, *isteğe bağlı*) : Ön oluşturulmuş metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, metin gömme değerleri `prompt` girdi argümanından oluşturulur. | |
| negative_prompt_embeds (`torch.FloatTensor`, *isteğe bağlı*) : Önceden oluşturulmuş negatif metin gömme değerleri. Metin girdilerini kolayca ayarlamak için kullanılabilir, *ör.* istem ağırlıklandırması. Sağlanmazsa, negative_prompt_embeds, `negative_prompt` girdi argümanından oluşturulur. | |
Xet Storage Details
- Size:
- 13.3 kB
- Xet hash:
- 2067d61011c9c7874f20c26ef6b1c2f2ceb8d716ab97a36f3393dbad09e70beb
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.