My-AI-Projects commited on
Commit
913c1cf
·
verified ·
1 Parent(s): 2df394e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -2,16 +2,17 @@ import gradio as gr
2
  import torch
3
  from diffusers import KolorsPipeline
4
 
5
- pipeline= KolorsPipeline.from_pretrained(
6
- "Kwai-Kolors/Kolors-diffusers",
7
- torch_dtype=torch.float16,
8
- variant="fp16"
9
- ).to("cuda" if torch.cuda.is_available() else "cpu")
 
10
 
11
  # Function to generate image from prompt
12
  def generate_image(prompt):
13
  # Use the pipeline to generate an image from the text prompt
14
- image = pipeline(prompt).images[0]
15
  return image
16
 
17
  # Create Gradio interface
 
2
  import torch
3
  from diffusers import KolorsPipeline
4
 
5
+ from diffusers import FluxPipeline
6
+
7
+ pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
8
+ pipe.load_lora_weights("Shakker-Labs/FLUX.1-dev-LoRA-Logo-Design", weight_name="FLUX-dev-lora-Logo-Design.safetensors")
9
+ pipe.fuse_lora(lora_scale=0.8)
10
+ pipe.to("cuda" if torch.cuda.is_available() else "cpu")
11
 
12
  # Function to generate image from prompt
13
  def generate_image(prompt):
14
  # Use the pipeline to generate an image from the text prompt
15
+ image = pipe(prompt).images[0]
16
  return image
17
 
18
  # Create Gradio interface