import os import spaces import gradio as gr import torch import logging from diffusers import DiffusionPipeline import subprocess # os.environ["CUDA_HOME"] = "/usr/local/cuda" # CUDA_TOOLKIT_FILE = "/tmp/%s" % os.path.basename(CUDA_TOOLKIT_URL) # CUDA_TOOLKIT_URL = "https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_535.54.03_linux.run" # subprocess.call(["wget", "-q", CUDA_TOOLKIT_URL, "-O", CUDA_TOOLKIT_FILE]) # subprocess.call(["chmod", "+x", CUDA_TOOLKIT_FILE]) # subprocess.call([CUDA_TOOLKIT_FILE, "--toolkit"]) # os.environ["CUDA_HOME"] = "/usr/local/cuda" pipe = DiffusionPipeline.from_pretrained("azaneko/HiDream-I1-Fast-nf4") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0]