Hermes Bot commited on
Commit
9ca7af9
·
1 Parent(s): f8d77bc

Remove inner random import to avoid UnboundLocalError

Browse files
core/pipelines/sd_image_pipeline.py CHANGED
@@ -247,7 +247,7 @@ class SdImagePipeline(BasePipeline):
247
  # metadata to display. We restore the behaviour here.
248
  # -----------------------------------------------------------------
249
  from PIL import Image, PngImagePlugin
250
- import json, random, os
251
  # Build the same param string used previously in `_gpu_logic`
252
  params_string = f"{ui_inputs['positive_prompt']}\nNegative prompt: {ui_inputs['negative_prompt']}\n"
253
  params_string += f"Steps: {ui_inputs['num_inference_steps']}, Sampler: {ui_inputs['sampler']}, Scheduler: {ui_inputs['scheduler']}, CFG scale: {ui_inputs['guidance_scale']}, Seed: {ui_inputs['seed']}, Size: {ui_inputs.get('width', 'N/A')}x{ui_inputs.get('height', 'N/A')}, Base Model: {model_display_name}"
 
247
  # metadata to display. We restore the behaviour here.
248
  # -----------------------------------------------------------------
249
  from PIL import Image, PngImagePlugin
250
+ import json, os
251
  # Build the same param string used previously in `_gpu_logic`
252
  params_string = f"{ui_inputs['positive_prompt']}\nNegative prompt: {ui_inputs['negative_prompt']}\n"
253
  params_string += f"Steps: {ui_inputs['num_inference_steps']}, Sampler: {ui_inputs['sampler']}, Scheduler: {ui_inputs['scheduler']}, CFG scale: {ui_inputs['guidance_scale']}, Seed: {ui_inputs['seed']}, Size: {ui_inputs.get('width', 'N/A')}x{ui_inputs.get('height', 'N/A')}, Base Model: {model_display_name}"