Buckets:

hf-doc-build/doc / diffusers /main /ar /using-diffusers /legacy_checkpoints.md
mishig's picture
|
download
raw
3.93 kB
# نقاط التفتيش القديمة
تنطبق هذه الإعدادات بشكل رئيسي على نقاط التفتيش الأقدم من عائلة Stable Diffusion.
## فاحص الأمان
توفر مكتبة Diffusers [فاحص أمان](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/safety_checker.py) لنقاط التثبيت القديمة من Stable Diffusion لمنع توليد محتوى ضار. يقوم هذا الفاحص بفحص المخرجات المولّدة مقابل مجموعة من المفاهيم الضارة المدمجة مسبقًا. أما النماذج الأحدث مثل Qwen-Image فلا تتضمن هذا الفاحص.
إذا كنت ترغب في تعطيل فاحص الأمان، فمرر `safety_checker=None` في [from_pretrained()](/docs/diffusers/main/ar/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained) كما هو موضح أدناه.
```py
from diffusers import DiffusionPipeline
pipeline = DiffusionPipeline.from_pretrained(
"stable-diffusion-v1-5/stable-diffusion-v1-5", safety_checker=None
)
"""
You have disabled the safety checker for <class 'diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline'> by passing `safety_checker=None`. Ensure that you abide by the conditions of the Stable Diffusion license and do not expose unfiltered results in services or applications open to the public. Both the diffusers team and Hugging Face strongly recommend keeping the safety filter enabled in all public-facing circumstances, disabling it only for use cases that involve analyzing network behavior or auditing its results. For more information, please have a look at https://github.com/huggingface/diffusers/pull/254 .
"""
```
## جدولة إعادة التحجيم
تبدأ عملية إزالة الضوضاء من ضوضاء نقية، لذا فإن نسبة الإشارة إلى الضوضاء (SNR) تبدأ من الصفر. بعض النماذج لا تبدأ فعليًا من ضوضاء نقية، مما يجعل توليد القيم القصوى الساطعة والداكنة أمرًا صعبًا.
> [!TIP]
> درّب نموذجك الخاص باستخدام `v_prediction` عن طريق إضافة علم `--prediction_type="v_prediction"` إلى سكربت التدريب الخاص بك. يمكنك أيضًا [البحث](https://huggingface.co/search/full-text?q=v_prediction&type=model) عن نماذج موجودة تم تدريبها باستخدام `v_prediction`.
لنموذج `v_prediction`، فعّل هذه الحجج الخاصة بمجدول التدرج.
- اضبط `rescale_betas_zero_snr=True` لإعادة مقياس جدول الضوضاء إلى الخطوة الزمنية الأخيرة تماماً مع نسبة إشارة إلى ضوضاء صفرية تماماً
- اضبط `timestep_spacing="trailing"` لفرض أخذ العينات من خطوة الزمن الأخيرة مع ضوضاء نقية
```py
from diffusers import DiffusionPipeline, DDIMScheduler
pipeline = DiffusionPipeline.from_pretrained("ptx0/pseudo-journey-v2", device_map="cuda") # or "mps", "xpu", "cpu"
pipeline.scheduler = DDIMScheduler.from_config(
pipeline.scheduler.config, rescale_betas_zero_snr=True, timestep_spacing="trailing"
)
```
اضبط `guidance_rescale` في خط الأنابيب لتجنب الصور المفرطة الإضاءة. القيمة الأقل تزيد من السطوع، لكن قد تبدو بعض التفاصيل باهتة.
```py
prompt = """
cinematic photo of a snowy mountain at night with the northern lights aurora borealis
overhead, 35mm photograph, film, professional, 4k, highly detailed
"""
image = pipeline(prompt, guidance_rescale=0.7).images[0]
```
بدون SNR صفري
بصفر نسبة الإشارة إلى الضوضاء ومسافة لاحقة

Xet Storage Details

Size:
3.93 kB
·
Xet hash:
7ada625b22db3d007c6cbfb99433ed730c2c9b85647939d4c8447941ba122616

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.