fffiloni commited on
Commit
c1071da
1 Parent(s): 7d3dd84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -28,6 +28,7 @@ pipe = StableDiffusionXLControlNetPipeline.from_pretrained(
28
  )
29
  pipe.to("cuda")
30
 
 
31
 
32
  #pipe.enable_model_cpu_offload()
33
 
@@ -51,6 +52,8 @@ def infer(model_name, image_in, prompt, controlnet_conditioning_scale, guidance_
51
  image = Image.fromarray(image)
52
 
53
  lora_scale= 0.9
 
 
54
 
55
  images = pipe(
56
  prompt,
@@ -59,7 +62,7 @@ def infer(model_name, image_in, prompt, controlnet_conditioning_scale, guidance_
59
  controlnet_conditioning_scale=controlnet_conditioning_scale,
60
  guidance_scale = guidance_scale,
61
  num_inference_steps=50,
62
- seed=seed,
63
  cross_attention_kwargs={"scale": lora_scale}
64
  ).images
65
 
 
28
  )
29
  pipe.to("cuda")
30
 
31
+ generator = torch.Generator(device="cuda")
32
 
33
  #pipe.enable_model_cpu_offload()
34
 
 
52
  image = Image.fromarray(image)
53
 
54
  lora_scale= 0.9
55
+
56
+
57
 
58
  images = pipe(
59
  prompt,
 
62
  controlnet_conditioning_scale=controlnet_conditioning_scale,
63
  guidance_scale = guidance_scale,
64
  num_inference_steps=50,
65
+ generator=generator.manual_seed(seed),
66
  cross_attention_kwargs={"scale": lora_scale}
67
  ).images
68