Oranblock commited on
Commit
3f0b9c3
·
verified ·
1 Parent(s): 222fc77

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -73,7 +73,13 @@ CACHE_EXAMPLES = torch.cuda.is_available() and os.getenv("CACHE_EXAMPLES", "0")
73
 
74
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
75
 
76
- NUM_IMAGES_PER_PROMPT = 6 # Set maximum images per prompt
 
 
 
 
 
 
77
 
78
  # Convert mm to pixels for a specific DPI (300)
79
  def mm_to_pixels(mm, dpi=300):
@@ -150,7 +156,7 @@ def generate(
150
  "guidance_scale": guidance_scale,
151
  "num_inference_steps": 25,
152
  "generator": generator,
153
- "num_images_per_prompt": NUM_IMAGES_PER_PROMPT,
154
  "output_type": "pil",
155
  }
156
 
 
73
 
74
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
75
 
76
+ # Initialize the DiffusionPipeline (this was missing)
77
+ pipe = DiffusionPipeline.from_pretrained(
78
+ "SG161222/RealVisXL_V3.0_Turbo", # or any model of your choice
79
+ torch_dtype=torch.float16,
80
+ use_safetensors=True,
81
+ variant="fp16"
82
+ ).to(device)
83
 
84
  # Convert mm to pixels for a specific DPI (300)
85
  def mm_to_pixels(mm, dpi=300):
 
156
  "guidance_scale": guidance_scale,
157
  "num_inference_steps": 25,
158
  "generator": generator,
159
+ "num_images_per_prompt": 6, # Max 6 images
160
  "output_type": "pil",
161
  }
162