yasserrmd commited on
Commit
4ef16a2
·
verified ·
1 Parent(s): ab57896

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -7,8 +7,8 @@ import spaces
7
 
8
  device=torch.device('cuda')
9
 
10
-
11
-
12
 
13
 
14
 
@@ -33,7 +33,7 @@ def generate_sketch(prompt,style, num_inference_steps, guidance_scale):
33
  # return gr.update(visible=False),gr.Text(value="Inappropriate prompt detected. Please try another prompt.")
34
  print(prompt)
35
 
36
- pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
37
  if style=='shou_xin':
38
  prompt= "shou_xin, " + prompt
39
  pipe.load_lora_weights("Datou1111/shou_xin", weight_name="shou_xin.safetensors")
@@ -42,7 +42,7 @@ def generate_sketch(prompt,style, num_inference_steps, guidance_scale):
42
  pipe.load_lora_weights("Shakker-Labs/FLUX.1-dev-LoRA-Children-Simple-Sketch", weight_name="FLUX-dev-lora-children-simple-sketch.safetensors")
43
 
44
  pipe.fuse_lora(lora_scale=1.5)
45
- pipe.to("cuda")
46
 
47
  image = pipe("sketched style, " + prompt,
48
  num_inference_steps=num_inference_steps,
 
7
 
8
  device=torch.device('cuda')
9
 
10
+ pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
11
+ pipe.to("cuda")
12
 
13
 
14
 
 
33
  # return gr.update(visible=False),gr.Text(value="Inappropriate prompt detected. Please try another prompt.")
34
  print(prompt)
35
 
36
+
37
  if style=='shou_xin':
38
  prompt= "shou_xin, " + prompt
39
  pipe.load_lora_weights("Datou1111/shou_xin", weight_name="shou_xin.safetensors")
 
42
  pipe.load_lora_weights("Shakker-Labs/FLUX.1-dev-LoRA-Children-Simple-Sketch", weight_name="FLUX-dev-lora-children-simple-sketch.safetensors")
43
 
44
  pipe.fuse_lora(lora_scale=1.5)
45
+
46
 
47
  image = pipe("sketched style, " + prompt,
48
  num_inference_steps=num_inference_steps,