import torch import gradio as gr from diffusers import StableDiffusionPipeline class CFG: device = 'cpu' seed = 42 Generator = torch.Generator(device).manual_seed(seed) image_gen_steps = 35 image_gen_model_id = 'stabilityai/stable-diffusion-2' image_gen_size = (400, 400) image_gen_guidance_scale = 9 image_gen_model = StableDiffusionPipeline.from_pretrained( CFG.image_gen_model_id, torch_dtype=torch.float32, revision="fp16", use_auth_token='hf_' )