keplersj commited on
Commit
be608b3
·
1 Parent(s): 9f99808

gen controls in sidebar

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -7,9 +7,14 @@ processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-larg
7
  model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-large")
8
  pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4")
9
 
10
- files = st.file_uploader("Upload images to blend", accept_multiple_files=True)
11
  descs = []
12
 
 
 
 
 
 
 
13
  for file_name in files:
14
  image = Image.open(file_name)
15
 
@@ -22,5 +27,6 @@ for file_name in files:
22
 
23
  if len(descs) > 0:
24
  description = ' '.join(descs)
25
- for image in pipe(description).images:
 
26
  st.image(image, caption=description)
 
7
  model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-large")
8
  pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4")
9
 
 
10
  descs = []
11
 
12
+ with st.sidebar:
13
+ image_gen_guidance = st.slider("Stable Diffusion: Guidance Scale", value=7.5)
14
+ image_gen_steps = st.slider("stable Diffusion: Inference Steps", value=50)
15
+
16
+ files = st.file_uploader("Upload images to blend", accept_multiple_files=True)
17
+
18
  for file_name in files:
19
  image = Image.open(file_name)
20
 
 
27
 
28
  if len(descs) > 0:
29
  description = ' '.join(descs)
30
+ images = pipe(description, guidance_scale=image_gen_guidance, num_inference_steps=image_gen_steps).images
31
+ for image in images:
32
  st.image(image, caption=description)