The next step is to tokenize the text to generate embeddings. The text is used to condition the UNet model and steer the diffusion process towards something that resembles the input prompt.  
<Tip>  
💡 The `guidance_scale` parameter determines how much weight should be given to the prompt when generating an image.  
</Tip>  
Feel free to choose any prompt you like if you want to generate something else!  
```py
>>> prompt = ["a photograph of an astronaut riding a horse"]
>>> height = 512  # default height of Stable Diffusion
>>> width = 512  # default width of Stable Diffusion
>>> num_inference_steps = 25  # Number of denoising steps
>>> guidance_scale = 7.5  # Scale for classifier-free guidance
>>> generator = torch.manual_seed(0)  # Seed generator to create the initial latent noise
>>> batch_size = len(prompt)
```  
Tokenize the text and generate the embeddings from the prompt:  
```py
>>> text_input = tokenizer(
...     prompt, padding="max_length", max_length=tokenizer.model_max_length, truncation=True, return_tensors="pt"
... )

>>> with torch.no_grad():
...     text_embeddings = text_encoder(text_input.input_ids.to(torch_device))[0]
```  
You'll also need to generate the *unconditional text embeddings* which are the embeddings for the padding token. These need to have the same shape (`batch_size` and `seq_length`) as the conditional `text_embeddings`:  
```py
>>> max_length = text_input.input_ids.shape[-1]
>>> uncond_input = tokenizer([""] * batch_size, padding="max_length", max_length=max_length, return_tensors="pt")
>>> uncond_embeddings = text_encoder(uncond_input.input_ids.to(torch_device))[0]
```  
Let's concatenate the conditional and unconditional embeddings into a batch to avoid doing two forward passes:  
```py
>>> text_embeddings = torch.cat([uncond_embeddings, text_embeddings])
```
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/write_own_pipeline.md