Spaces:
Runtime error
Runtime error
beyonddata
commited on
Commit
β’
5388705
1
Parent(s):
14dea71
Upload folder using huggingface_hub
Browse files- README.md +2 -8
- main.py +19 -0
- requirements.txt +6 -0
README.md
CHANGED
@@ -1,12 +1,6 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
|
4 |
-
colorFrom: green
|
5 |
-
colorTo: purple
|
6 |
sdk: gradio
|
7 |
sdk_version: 3.50.2
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: diffuser5
|
3 |
+
app_file: main.py
|
|
|
|
|
4 |
sdk: gradio
|
5 |
sdk_version: 3.50.2
|
|
|
|
|
6 |
---
|
|
|
|
main.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
+
import gradio as gr
|
3 |
+
import torch
|
4 |
+
from diffusers import DiffusionPipeline
|
5 |
+
import uvicorn
|
6 |
+
from diffusers import AutoPipelineForImage2Image
|
7 |
+
|
8 |
+
description = "Image generation with GPT-2"
|
9 |
+
title = "IMAGE GENERATION MACHINE"
|
10 |
+
|
11 |
+
pipeline = AutoPipelineForImage2Image.from_pretrained(
|
12 |
+
"runwayml/stable-diffusion-v1-5",
|
13 |
+
torch_dtype=torch.float16,
|
14 |
+
# use_safetensors=True,
|
15 |
+
)#.to('cuda')
|
16 |
+
|
17 |
+
gr.Interface.from_pipeline(pipeline)
|
18 |
+
|
19 |
+
interface.launch(share = True)
|
requirements.txt
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
fastapi
|
2 |
+
torch==2.1.0
|
3 |
+
diffusers
|
4 |
+
transformers
|
5 |
+
uvicorn
|
6 |
+
gradio
|