Team Ai
Apppublic

diffusers/benchmark

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes
app.cpython-310.pyc12 linesDownload Raw Back to __pycache__
1o

2%'e��@s�ddlZddlZddlmZddlZdZejZe�	d�Z	ej3dded�Ze�e	�er5ej
ejdd	d4�e_ddefd
d�Zejdd��%Zejdddddd�Ze�d�jdddd�Zejeegd�Wd�n1skwYejd	d�dS)�N)�AutoPipelineForText2ImageFzcuda:0z(stabilityai/stable-diffusion-xl-base-1.0�fp16)�variant�torch_dtypezreduce-overheadT)�mode�	fullgraph��num_images_per_promptcCsTd}d}t��}t|||d�jt��}td|�d�||�td|||�dS)N�Maaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa�()r	�num_inference_stepszFor z stepszAvg per step)�time�pipeline�images�print)r	�promptr�5start_time�end_time�r�/home/patrick/benchmark/app.py�generatesrz	style.css)�cssz6Batch size�)�label�minimum�maximum�step�valuez7Benchmark!)FTTF)�margin�rounded�8full_width)�fn�inputs)�share)r)�gradio�gr�torch�	diffusersrr
�USE_TORCH_COMPILE�float16�dtype�device�from_pretrainedr�to�compile�unet�intr�Blocks�demo�Slider�9batch_size�Button�style�btn�click�launchrrrr�<module>s81011�12��