






"""simple docstring"""
import torch

from diffusers import DiffusionPipeline


class _lowerCAmelCase						(    __UpperCAmelCase       ):







						def __init__(    self   ,				lowerCAmelCase_   ,				lowerCAmelCase_							)		->							int:
										super().__init__()

										self.register_modules(unet=lowerCAmelCase_   ,				scheduler=lowerCAmelCase_							)







						def __call__(    self							)		->							List[Any]:
										_SCREAMING_SNAKE_CASE   :		Any       		=    torch.randn(
										    (1, self.unet.config.in_channels, self.unet.config.sample_size, self.unet.config.sample_size)   ,				)
										_SCREAMING_SNAKE_CASE   :		Union[str, Any]       		=    1

										_SCREAMING_SNAKE_CASE   :		Tuple       		=    self.unet(lowerCAmelCase_   ,				lowerCAmelCase_							).sample
										_SCREAMING_SNAKE_CASE   :		Any       		=    self.scheduler.step(lowerCAmelCase_   ,				lowerCAmelCase_   ,				lowerCAmelCase_							).prev_sample

										_SCREAMING_SNAKE_CASE   :		Dict       		=    scheduler_output - scheduler_output + torch.ones_like(lowerCAmelCase_							)

										return result









"""simple docstring"""
from datetime import datetime

import requests
from bsa import BeautifulSoup

if __name__ == "__main__":
			lowerCAmelCase__    						=			input('Enter image url: ').strip()
			print(F'Downloading image from {url} ...')
			lowerCAmelCase__    						=			BeautifulSoup(requests.get(url).content, 'html.parser')
			# The image URL is in the content field of the first meta tag with property og:image
			lowerCAmelCase__    						=			soup.find('meta', {'property': 'og:image'})['content']
			lowerCAmelCase__    						=			requests.get(image_url).content
			lowerCAmelCase__    						=			F'{datetime.now():%Y-%m-%d_%H:%M:%S}.jpg'
			with open(file_name, 'wb') as fp:
						fp.write(image_data)
			print(F'Done. Image saved to disk as {file_name}.')

