Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,25 +1 @@
|
|
1 |
-
import
|
2 |
-
import requests
|
3 |
-
import json
|
4 |
-
|
5 |
-
from gradio_client import Client
|
6 |
-
|
7 |
-
client = Client("artificialguybr/RealVisXL-Free-DEMO")
|
8 |
-
result = client.predict(
|
9 |
-
prompt="Hello!!",
|
10 |
-
negative_prompt="",
|
11 |
-
seed=0,
|
12 |
-
custom_width=896,
|
13 |
-
custom_height=1152,
|
14 |
-
guidance_scale=7,
|
15 |
-
num_inference_steps=28,
|
16 |
-
sampler="DPM++ 2M SDE Karras",
|
17 |
-
aspect_ratio_selector="1024 x 1024",
|
18 |
-
use_upscaler=False,
|
19 |
-
upscaler_strength=0.55,
|
20 |
-
upscale_by=1.5,
|
21 |
-
api_name="/run"
|
22 |
-
)
|
23 |
-
print(result)
|
24 |
-
|
25 |
-
app.launch(show_api=False, share=False, error=True)
|
|
|
1 |
+
import torch; from diffusers import StableDiffusionPipeline; model_id = "CompVis/stable-diffusion-v1-4"; pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16); def text_to_image(text): image = pipe(text).images[0]; image.save("image.png"); text_to_image("A futuristic cityscape with flying cars and towering skyscrapers.");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|