JavierGon12 commited on
Commit
e77b808
1 Parent(s): 48b11be

add accelerator and change order of the colors

Browse files
Files changed (2) hide show
  1. pages/Text to Image.py +2 -1
  2. requirements.txt +2 -1
pages/Text to Image.py CHANGED
@@ -1,6 +1,7 @@
1
  import torch
2
  from diffusers import LCMScheduler, AutoPipelineForText2Image
3
  import streamlit as st
 
4
 
5
  model_id = "stabilityai/stable-diffusion-xl-base-1.0"
6
  adapter_id = "latent-consistency/lcm-lora-sdxl"
@@ -16,4 +17,4 @@ prompt = st.text_input(str("Insert here you prompt?"))
16
 
17
  # disable guidance_scale by passing 0
18
  image = pipe(prompt=prompt, num_inference_steps=4, guidance_scale=0).images[0]
19
- st.image(image,"Image generated by your prompt {promt}")
 
1
  import torch
2
  from diffusers import LCMScheduler, AutoPipelineForText2Image
3
  import streamlit as st
4
+ import accelerate
5
 
6
  model_id = "stabilityai/stable-diffusion-xl-base-1.0"
7
  adapter_id = "latent-consistency/lcm-lora-sdxl"
 
17
 
18
  # disable guidance_scale by passing 0
19
  image = pipe(prompt=prompt, num_inference_steps=4, guidance_scale=0).images[0]
20
+ st.image(image,f"Image generated by your prompt {prompt}")
requirements.txt CHANGED
@@ -11,4 +11,5 @@ pypdf
11
  st-pages
12
  torchaudio
13
  sentencepiece
14
- streamlit-extras
 
 
11
  st-pages
12
  torchaudio
13
  sentencepiece
14
+ streamlit-extras
15
+ accelerate