model_name = "stabilityai/stable-diffusion-2-base"
scheduler = GaudiDDIMScheduler.from_pretrained(model_name, subfolder="scheduler")
pipeline = GaudiStableDiffusionPipeline.from_pretrained(
model_name,
scheduler=scheduler,
use_habana=True,
use_hpu_graphs=True,
gaudi_config="Habana/stable-diffusion-2",
)
```  
Now you can call the pipeline to generate images by batches from one or several prompts:  
```python
outputs = pipeline(
prompt=[
"High quality photo of an astronaut riding a horse in space",