from datetime import datetime

import requests
from bsa import BeautifulSoup

if __name__ == "__main__":
	SCREAMING_SNAKE_CASE		:     List[Any]         =	input("Enter image url: ").strip()
	print(F'''Downloading image from {url} ...''')
	SCREAMING_SNAKE_CASE		:     Tuple         =	BeautifulSoup(requests.get(url).content, "html.parser")
	# The image URL is in the content field of the first meta tag with property og:image
	SCREAMING_SNAKE_CASE		:     List[Any]         =	soup.find("meta", {"property": "og:image"})["""content"""]
	SCREAMING_SNAKE_CASE		:     Dict         =	requests.get(image_url).content
	SCREAMING_SNAKE_CASE		:     Optional[Any]         =	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}.''')







"""simple docstring"""






import torch

from diffusers import StableDiffusionPipeline


__lowerCAmelCase       :			str   	="""path-to-your-trained-model"""
__lowerCAmelCase       :			int   	=StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.floataa).to("""cuda""")

__lowerCAmelCase       :			Optional[int]   	="""A photo of sks dog in a bucket"""
__lowerCAmelCase       :			int   	=pipe(prompt, num_inference_steps=5_0, guidance_scale=7.5).images[0]

image.save("""dog-bucket.png""")



