tokeron commited on
Commit
1e6a002
1 Parent(s): f852cc5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -53,8 +53,8 @@ If you have any questions, please feel free to open an issue or directly reach u
53
 
54
 
55
  model_num_of_layers = {
56
- 'Stable Diffusion 1.4': 12,
57
- 'Stable Diffusion 2.1': 22,
58
  }
59
 
60
  # def run_for_examples(prompt, model, seed, skip):
@@ -67,7 +67,9 @@ def generate_images(prompt, model, seed, skip):
67
  gr.Info('Generating images from intermediate layers..')
68
  all_images = [] # Initialize a list to store all images
69
  max_num_of_layers = model_num_of_layers[model]
70
- for skip_layers in range(max_num_of_layers - 1, -1, -1 * skip):
 
 
71
  # Pass the model and seed to the get_images function
72
  images = get_images(prompt, skip_layers=skip_layers, model=model, seed=seed)
73
  all_images.append((images[0], f'layer_{max_num_of_layers - skip_layers}'))
 
53
 
54
 
55
  model_num_of_layers = {
56
+ 'Stable Diffusion 1.4': 13,
57
+ 'Stable Diffusion 2.1': 23,
58
  }
59
 
60
  # def run_for_examples(prompt, model, seed, skip):
 
67
  gr.Info('Generating images from intermediate layers..')
68
  all_images = [] # Initialize a list to store all images
69
  max_num_of_layers = model_num_of_layers[model]
70
+ start_layer = max_num_of_layers % skip
71
+
72
+ for skip_layers in range(max_num_of_layers - start_layer, -1, -1 * skip):
73
  # Pass the model and seed to the get_images function
74
  images = get_images(prompt, skip_layers=skip_layers, model=model, seed=seed)
75
  all_images.append((images[0], f'layer_{max_num_of_layers - skip_layers}'))