tejani commited on
Commit
de62ac6
·
verified ·
1 Parent(s): 0f2c7e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -4,12 +4,17 @@ import torch
4
 
5
  # Load the quantized model from Hugging Face
6
  model_id = "Intel/sd-1.5-square-quantized"
7
- pipe = OVStableDiffusionPipeline.from_pretrained(model_id, export=False, library_name="diffusers")
 
 
 
 
 
8
 
9
  # Define the inference function
10
  def generate_image(prompt):
11
  # Generate the image
12
- image = pipe(prompt, num_inference_steps=5, guidance_scale=7.5).images[0]
13
  return image
14
 
15
  # Create the Gradio interface
 
4
 
5
  # Load the quantized model from Hugging Face
6
  model_id = "Intel/sd-1.5-square-quantized"
7
+ pipe = OVStableDiffusionPipeline.from_pretrained(
8
+ model_id,
9
+ export=False,
10
+ trust_remote_code=True, # Allow custom code if needed
11
+ ov_config={"CACHE_DIR": ""} # Optional: disable caching if it’s causing issues
12
+ )
13
 
14
  # Define the inference function
15
  def generate_image(prompt):
16
  # Generate the image
17
+ image = pipe(prompt, num_inference_steps=50, guidance_scale=7.5).images[0]
18
  return image
19
 
20
  # Create the Gradio interface