import spaces import gradio as gr from gradio_pannellum import Pannellum import torch from huggingface_hub import snapshot_download from txt2panoimg import Text2360PanoramaImagePipeline from PIL import Image import time # Download the model model_path = snapshot_download("archerfmy0831/sd-t2i-360panoimage") # Initialize pipelines txt2panoimg = Text2360PanoramaImagePipeline(model_path, torch_dtype=torch.float16) @spaces.GPU(duration=200) def text_to_pano(prompt, upscale): input_data = {'prompt': prompt, 'upscale': upscale, 'refinement': False} output = txt2panoimg(input_data) timestamp = int(time.time() * 1000) # Add this line return f"{output}?t={timestamp}", output # Modify this line title = """
360° Panorama Image Generation