Spaces:
Runtime error
Runtime error
horsey-defy commited on
Commit ·
f627998
1
Parent(s): 9831e0b
- Changed model/sampler responses
Browse files
app.py
CHANGED
|
@@ -14,13 +14,13 @@ import re
|
|
| 14 |
|
| 15 |
class RenderNet:
|
| 16 |
def __init__(self, api_key, base=None):
|
| 17 |
-
self.base = base or "https://
|
| 18 |
self.headers = {
|
| 19 |
-
"
|
| 20 |
}
|
| 21 |
|
| 22 |
def generate(self, params):
|
| 23 |
-
response = self._post(f"{self.base}/
|
| 24 |
return response.json()
|
| 25 |
|
| 26 |
def get_job(self, job_id):
|
|
@@ -37,12 +37,57 @@ class RenderNet:
|
|
| 37 |
return job_result
|
| 38 |
|
| 39 |
def list_models(self):
|
| 40 |
-
response =
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
def list_samplers(self):
|
| 44 |
-
response =
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
def _post(self, url, params):
|
| 48 |
headers = {
|
|
@@ -182,7 +227,7 @@ css = """
|
|
| 182 |
with gr.Blocks(css=css) as demo:
|
| 183 |
with gr.Row():
|
| 184 |
with gr.Column(scale=6):
|
| 185 |
-
model = gr.Dropdown(interactive=True,value="
|
| 186 |
|
| 187 |
with gr.Column(scale=1):
|
| 188 |
gr.Markdown(elem_id="powered-by-rendernet", value="AUTOMATIC1111 Stable Diffusion Web UI.<br>Powered by [RenderNet](https://rendernet.ai).<br>For more features and faster generation times check out our [API Docs](https://rendernet.ai/).")
|
|
@@ -192,8 +237,8 @@ with gr.Blocks(css=css) as demo:
|
|
| 192 |
with gr.Tab("txt2img", id='t2i'):
|
| 193 |
with gr.Row():
|
| 194 |
with gr.Column(scale=6, min_width=600):
|
| 195 |
-
prompt = gr.Textbox("
|
| 196 |
-
negative_prompt = gr.Textbox(placeholder="Negative Prompt", show_label=False, lines=3, value="
|
| 197 |
with gr.Column():
|
| 198 |
text_button = gr.Button("Generate", variant='primary', elem_id="generate")
|
| 199 |
|
|
@@ -221,7 +266,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 221 |
|
| 222 |
|
| 223 |
with gr.Column(scale=2):
|
| 224 |
-
image_output = gr.Image(value="https://
|
| 225 |
|
| 226 |
text_button.click(txt2img, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed], outputs=image_output)
|
| 227 |
|
|
|
|
| 14 |
|
| 15 |
class RenderNet:
|
| 16 |
def __init__(self, api_key, base=None):
|
| 17 |
+
self.base = base or "https://dev.rendernet.ai/api/"
|
| 18 |
self.headers = {
|
| 19 |
+
"rendernetapikey": api_key
|
| 20 |
}
|
| 21 |
|
| 22 |
def generate(self, params):
|
| 23 |
+
response = self._post(f"{self.base}/generate", params)
|
| 24 |
return response.json()
|
| 25 |
|
| 26 |
def get_job(self, job_id):
|
|
|
|
| 37 |
return job_result
|
| 38 |
|
| 39 |
def list_models(self):
|
| 40 |
+
response = ['dreamshaper_8.safetensors [879db523c3]',
|
| 41 |
+
'ghostmix_v20Bakedvae.safetensors [e3edb8a26f]',
|
| 42 |
+
'protovisionXLHighFidelity3D_beta0520Bakedvae.safetensors [0538f9319d]',
|
| 43 |
+
'meinaunreal_v41.safetensors [613844c3d2]',
|
| 44 |
+
'realisticVisionV51_v51VAE.safetensors [ef76aa2332]',
|
| 45 |
+
'flat2DAnimerge_v30.safetensors [5dd56bfa12]',
|
| 46 |
+
'impressionismOil_sd15.safetensors [852f3ba1f1]',
|
| 47 |
+
'absolutereality_v181.safetensors [463d6a9fe8]',
|
| 48 |
+
'meinamix_meinaV11.safetensors [54ef3e3610]',
|
| 49 |
+
'rpg_v5.safetensors [bb7e29def5]',
|
| 50 |
+
'westernAnimation_v1.safetensors [d20bc9d543]',
|
| 51 |
+
'dynavisionXLAllInOneStylized_beta0411Bakedvae.safetensors [255f68ed9a]',
|
| 52 |
+
'realvisxlV10_v10VAE.safetensors [8b379c4a8b]',
|
| 53 |
+
'abyssorangemix3AOM3_aom3a1b.safetensors [5493a0ec49]',
|
| 54 |
+
'AnythingV5Ink_v5PrtRE.safetensors [7f96a1a9ca]',
|
| 55 |
+
'dreamshaperXL10_alpha2Xl10.safetensors [0f1b80cfe8]',
|
| 56 |
+
'epicrealism_naturalSinRC1VAE.safetensors [84d76a0328]',
|
| 57 |
+
'mcbsMachinecodesComic_v2.safetensors [faebcebd4c]',
|
| 58 |
+
'newdawnxl_31Bf16Version.safetensors [d4d708e36c]',
|
| 59 |
+
'nextphoto_v30.safetensors [1c1f913f3b]',
|
| 60 |
+
'nightvisionXLPhotorealisticPortrait_v0743ReleaseBakedvae.safetensors [9550adb9d6]',
|
| 61 |
+
'juggernautXL_version5.safetensors [70229e1d56]',
|
| 62 |
+
'cyberrealistic_v33.safetensors [3c8530cb22]',
|
| 63 |
+
'realcartoon3d_v8.safetensors [4e089bea6e]',
|
| 64 |
+
'sdxlUnstableDiffusers_v7ElectricMind.safetensors [2a4411ef93]',
|
| 65 |
+
'icbinpICantBelieveIts_seco.safetensors [fa1224c923]',
|
| 66 |
+
'majicmixFantasy_v20.safetensors [bde6750eac]',
|
| 67 |
+
'analogMadness_v60.safetensors [c95a4e4a92]',
|
| 68 |
+
'blazingDrive_V10g.safetensors [ac9e281d80]',
|
| 69 |
+
'LahMysteriousSDXL_v40.safetensors [da5ddce194]',
|
| 70 |
+
'nightSkyYOZORAStyle_yozoraV1Origin.safetensors [e7bf829cff]',
|
| 71 |
+
'neverendingDreamNED_v122BakedVae.safetensors [ecefb796ff]',
|
| 72 |
+
'darkSushiMixMix_225D.safetensors [cca17b08da]',
|
| 73 |
+
'meinapastel_v6Pastel.safetensors [6292dd40d6]',
|
| 74 |
+
'meinaalter_v3.safetensors [ecc87bab9c]',
|
| 75 |
+
'counterfeitxl_v10.safetensors [9a0157cad2]',
|
| 76 |
+
'plagion_v10.safetensors [0c42b21c09]',
|
| 77 |
+
'replicantV30_v30.safetensors [cf65f48ecf]'
|
| 78 |
+
]
|
| 79 |
+
|
| 80 |
+
return response
|
| 81 |
|
| 82 |
def list_samplers(self):
|
| 83 |
+
response = [
|
| 84 |
+
'DPM++ SDE Karras',
|
| 85 |
+
'DPM++ 2M Karras'
|
| 86 |
+
'DPM++ 2S a Karras',
|
| 87 |
+
'Euler a',
|
| 88 |
+
'DPM++ 2M SDE Karras'
|
| 89 |
+
]
|
| 90 |
+
return response
|
| 91 |
|
| 92 |
def _post(self, url, params):
|
| 93 |
headers = {
|
|
|
|
| 227 |
with gr.Blocks(css=css) as demo:
|
| 228 |
with gr.Row():
|
| 229 |
with gr.Column(scale=6):
|
| 230 |
+
model = gr.Dropdown(interactive=True,value="dreamshaper_8.safetensors [879db523c3]", show_label=True, label="Stable Diffusion Checkpoint", choices=rendernet_client.list_models())
|
| 231 |
|
| 232 |
with gr.Column(scale=1):
|
| 233 |
gr.Markdown(elem_id="powered-by-rendernet", value="AUTOMATIC1111 Stable Diffusion Web UI.<br>Powered by [RenderNet](https://rendernet.ai).<br>For more features and faster generation times check out our [API Docs](https://rendernet.ai/).")
|
|
|
|
| 237 |
with gr.Tab("txt2img", id='t2i'):
|
| 238 |
with gr.Row():
|
| 239 |
with gr.Column(scale=6, min_width=600):
|
| 240 |
+
prompt = gr.Textbox("a master jedi cat in star wars with a lightsaber, wearing a jedi cloak hood in the kitchen (cat:1.3)", placeholder="Prompt", show_label=False, lines=3)
|
| 241 |
+
negative_prompt = gr.Textbox(placeholder="Negative Prompt", show_label=False, lines=3, value="(worst quality, low quality, normal quality:2)")
|
| 242 |
with gr.Column():
|
| 243 |
text_button = gr.Button("Generate", variant='primary', elem_id="generate")
|
| 244 |
|
|
|
|
| 266 |
|
| 267 |
|
| 268 |
with gr.Column(scale=2):
|
| 269 |
+
image_output = gr.Image(value="https://app.rendernet.ai/userfiles/1699956614571.5938.png")
|
| 270 |
|
| 271 |
text_button.click(txt2img, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed], outputs=image_output)
|
| 272 |
|