Programmation-informatique's picture
Update app.py
1cb0342
raw
history blame
No virus
557 Bytes
from diffusers import DiffusionPipeline
def generate_image(prompt):
model_id = "runwayml/stable-diffusion-v1-5"
pipeline = DiffusionPipeline.from_pretrained(model_id)
pipeline = pipeline.to("cuda")
generator = torch.Generator("cuda").manual_seed(0)
image = pipeline(prompt, generator=generator).images[0]
return image
iface = gr.Interface(
fn=generate_image,
inputs="text",
outputs="image",
title="Diffusion d'images",
description="Générez des images à partir d'une description.",
)
iface.launch()