File size: 794 Bytes
ff72db3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# import gradio as gr
# from transformers import pipeline
# # Hugging Face ์ด๋ฏธ์ง ์์ฑ ๋ชจ๋ธ ๋ก๋
# image_generator = pipeline("image-generation", model="CompVis/stable-diffusion-v1-4")
# # ํจ์ ์ ์
# def generate_image(prompt):
# result = image_generator(prompt)
# return result[0]["image"]
# # Gradio ์ธํฐํ์ด์ค
# demo = gr.Interface(
# fn=generate_image, # ํจ์ ์ฐ๊ฒฐ
# inputs=gr.Textbox(label="Image Prompt"), # ์
๋ ฅ ํ
์คํธ ๋ฐ์ค
# outputs="image", # ์ถ๋ ฅ ์ด๋ฏธ์ง
# title="Image Generation with Stable Diffusion",
# description="Enter a prompt, and the Stable Diffusion model will generate an image.",
# )
# # ์ธํฐํ์ด์ค ์คํ
# if __name__ == "__main__":
# demo.launch()
|