# 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()