import gradio as gr import torch from diffusers import DiffusionPipeline # from diffusers import StableDiffusionPipeline def generate(prompt): # pipeline = DiffusionPipeline.from_pretrained("jayparmr/CyberRealistic", torch_dtype=torch.float16) pipeline = DiffusionPipeline.from_pretrained("jayparmr/rcnz", use_auth_token="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", torch_dtype=torch.float16) pipeline.to("cuda") return pipeline(prompt).images[0] iface = gr.Interface(fn=generate, inputs="text", outputs="image") iface.launch()