Spaces:
Runtime error
Runtime error
File size: 574 Bytes
dd942ed 4f5c4c2 dd942ed |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
from diffusers import StableDiffusionPipeline
# Load FLUX-IP-Adapter-v2
model_id = "XLabs-AI/flux-ip-adapter-v2"
pipeline = StableDiffusionPipeline.from_pretrained(model_id, revision="main")
pipeline.to("cuda") # Use GPU if available
import gradio as gr
def generate_scene(image, prompt):
result = pipeline(prompt=prompt, image=image).images[0]
return result
interface = gr.Interface(
fn=generate_scene,
inputs=["image", "text"],
outputs="image",
title="FLUX-IP-Adapter-v2 Image Generation"
)
if __name__ == "__main__":
interface.launch()
|