Shilpaj commited on
Commit
00c204f
·
verified ·
1 Parent(s): 6ac6d43

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -15,7 +15,8 @@ from utils import (
15
  load_models, clear_gpu_memory, set_timesteps, latents_to_pil,
16
  vignette_loss, get_concept_embedding, image_grid
17
  )
18
- from diffusers import StableDiffusionPipeline
 
19
 
20
 
21
  def generate_latents(prompt, seed, num_inference_steps, guidance_scale, vignette_loss_scale, concept, concept_strength, height, width):
@@ -146,8 +147,8 @@ def generate_style_images(prompt, num_inference_steps=30, guidance_scale=7.5,
146
  concept_labels = []
147
 
148
  # Load and remove the "none" element
149
- concepts_list = art_concepts.keys()
150
- concepts_list.pop()
151
 
152
  for seed_no, concept in zip(seed_list, concepts_list):
153
  # Clear the CUDA cache
@@ -178,6 +179,8 @@ def create_demo():
178
  with gr.Row():
179
  with gr.Column():
180
  all_styles = ["none"] + list(art_concepts.keys())
 
 
181
 
182
  prompt = gr.Textbox(label="Prompt", placeholder="A cat sitting on a chair")
183
  seed = gr.Slider(minimum=0, maximum=10000, step=1, label="Seed", value=1000)
 
15
  load_models, clear_gpu_memory, set_timesteps, latents_to_pil,
16
  vignette_loss, get_concept_embedding, image_grid
17
  )
18
+ # Remove this import to avoid the cached_download error
19
+ # from diffusers import StableDiffusionPipeline
20
 
21
 
22
  def generate_latents(prompt, seed, num_inference_steps, guidance_scale, vignette_loss_scale, concept, concept_strength, height, width):
 
147
  concept_labels = []
148
 
149
  # Load and remove the "none" element
150
+ concepts_list = list(art_concepts.keys())
151
+ concepts_list.remove("none")
152
 
153
  for seed_no, concept in zip(seed_list, concepts_list):
154
  # Clear the CUDA cache
 
179
  with gr.Row():
180
  with gr.Column():
181
  all_styles = ["none"] + list(art_concepts.keys())
182
+ all_styles.remove("none") # Remove "none" to avoid duplication
183
+ all_styles = ["none"] + all_styles # Add it back at the beginning
184
 
185
  prompt = gr.Textbox(label="Prompt", placeholder="A cat sitting on a chair")
186
  seed = gr.Slider(minimum=0, maximum=10000, step=1, label="Seed", value=1000)