nathanrish commited on
Commit
f5ec556
1 Parent(s): 7d93212

modified app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -36
app.py CHANGED
@@ -1,38 +1,3 @@
1
  import gradio as gr
2
- from transformers import pipeline
3
- import random
4
 
5
- # Load the model
6
- text_to_image_pipeline = pipeline("text-to-image", model="models/Shakker-Labs/FLUX.1-dev-LoRA-add-details")
7
-
8
- def generate_image(prompt, cfg_scale, steps, width, height, randomize_seed, seed_value, lora_scale):
9
- # Randomize seed if checkbox is checked
10
- if randomize_seed:
11
- seed_value = random.randint(0, 10000)
12
-
13
- # Use the model to generate an image based on the input parameters
14
- # Here we assume `text_to_image_pipeline` can accept these parameters
15
- return text_to_image_pipeline(prompt, cfg_scale=cfg_scale, steps=steps, width=width, height=height, seed=seed_value, lora_scale=lora_scale)
16
-
17
- # Define the Gradio interface
18
- interface = gr.Interface(
19
- fn=generate_image,
20
- inputs=[
21
- gr.Textbox(label="Enter your text prompt"),
22
- gr.Slider(minimum=0, maximum=100, step=0.1, default=7.5, label="CFG Scale"),
23
- gr.Slider(minimum=1, maximum=100, step=1, default=25, label="Steps"),
24
- gr.Slider(minimum=64, maximum=1024, step=8, default=512, label="Width"),
25
- gr.Slider(minimum=64, maximum=1024, step=8, default=512, label="Height"),
26
- gr.Checkbox(label="Randomize Seed"),
27
- gr.Slider(minimum=0, maximum=10000, step=1, default=1234, label="Seed"),
28
- gr.Slider(minimum=0, maximum=10, step=0.1, default=1.0, label="Lora Scale")
29
- ],
30
- outputs=gr.Image(label="Generated Image"),
31
- title="Advanced Text-to-Image Generation",
32
- description="Enter a text prompt and adjust the settings to generate an image.",
33
- theme="dark",
34
- layout="vertical"
35
- )
36
-
37
- # Launch the interface
38
- interface.launch()
 
1
  import gradio as gr
 
 
2
 
3
+ gr.load("models/Shakker-Labs/FLUX.1-dev-LoRA-add-details").launch()