ai-humanizer / app.py
a-real-human's picture
Upload folder using huggingface_hub
528dd5e verified
Raw
History Blame Contribute Delete
18.8 kB
import gradio as gr
import time
import html
ACCENT = "#5f73e7"
ACCENT_DARK = "#4e64d6"
ICON_SPARKLES = """<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" width="18" height="18" style="vertical-align:-3px;margin-right:6px"><path stroke-linecap="round" stroke-linejoin="round" d="M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z" /></svg>"""
ICON_CHECK_CIRCLE = """<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#5f73e7" width="48" height="48"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>"""
ICON_ARROW_RIGHT = """<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" width="16" height="16" style="vertical-align:-2px;margin-left:6px"><path stroke-linecap="round" stroke-linejoin="round" d="M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3" /></svg>"""
CSS = f"""
body {{ font-family: 'Inter', sans-serif; }}
.main-header {{
text-align: center;
padding: 20px 0 10px;
}}
.main-header h1 {{
font-size: 2.2rem;
font-weight: 800;
background: linear-gradient(135deg, {ACCENT_DARK}, {ACCENT});
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-bottom: 6px;
}}
.main-header p {{
color: #6b7280;
font-size: 1rem;
margin: 0;
}}
.stats-bar {{
display: flex;
justify-content: center;
gap: 40px;
padding: 12px 0;
border-top: 1px solid #e5e7eb;
border-bottom: 1px solid #e5e7eb;
margin: 16px 0;
}}
.stats-bar .stat {{
text-align: center;
}}
.stats-bar .stat-value {{
font-size: 1.3rem;
font-weight: 700;
color: {ACCENT};
}}
.stats-bar .stat-label {{
font-size: 0.75rem;
color: #9ca3af;
text-transform: uppercase;
letter-spacing: 0.05em;
}}
.output-placeholder {{
border: 2px dashed #e5e7eb;
border-radius: 8px;
min-height: 220px;
display: flex;
align-items: center;
justify-content: center;
color: #9ca3af;
font-size: 0.95rem;
padding: 20px;
text-align: center;
}}
#btn-row {{
justify-content: center !important;
}}
.humanize-btn {{
background: linear-gradient(135deg, {ACCENT_DARK}, {ACCENT}) !important;
border: none !important;
color: white !important;
font-size: 1.05rem !important;
font-weight: 600 !important;
padding: 14px 40px !important;
border-radius: 8px !important;
cursor: pointer !important;
white-space: nowrap !important;
min-width: 200px !important;
max-width: 260px !important;
}}
.humanize-btn:hover {{
opacity: 0.92 !important;
}}
.cta-overlay {{
position: absolute;
inset: 0;
background: rgba(255,255,255,0.88);
backdrop-filter: blur(2px);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border-radius: 8px;
padding: 24px;
text-align: center;
z-index: 10;
}}
.cta-overlay .cta-icon {{
margin-bottom: 8px;
}}
.cta-overlay .cta-title {{
font-size: 1.15rem;
font-weight: 700;
color: #111827;
margin-bottom: 6px;
}}
.cta-overlay .cta-sub {{
font-size: 0.9rem;
color: #6b7280;
margin-bottom: 18px;
max-width: 340px;
line-height: 1.5;
}}
.cta-overlay .cta-btn {{
display: inline-flex;
align-items: center;
background: linear-gradient(135deg, {ACCENT_DARK}, {ACCENT});
color: white !important;
font-size: 1rem;
font-weight: 700;
padding: 13px 32px;
border-radius: 8px;
text-decoration: none;
transition: opacity 0.2s;
box-shadow: 0 4px 14px rgba(95,115,231,0.4);
}}
.cta-overlay .cta-btn:hover {{ opacity: 0.88; }}
.cta-overlay .cta-link {{
display: block;
margin-top: 10px;
font-size: 0.82rem;
color: #9ca3af;
}}
.seo-section {{
padding: 48px 24px;
max-width: 860px;
margin: 0 auto;
color: #374151;
line-height: 1.75;
}}
.seo-section h2 {{
font-size: 1.5rem;
font-weight: 700;
color: #111827;
margin-top: 36px;
margin-bottom: 10px;
}}
.seo-section h3 {{
font-size: 1.1rem;
font-weight: 600;
color: #1f2937;
margin-top: 24px;
margin-bottom: 8px;
}}
.seo-section p {{
margin-bottom: 12px;
font-size: 0.95rem;
}}
.seo-section ul {{
padding-left: 20px;
margin-bottom: 12px;
}}
.seo-section ul li {{
margin-bottom: 6px;
font-size: 0.95rem;
}}
.badge-row {{
display: flex;
flex-wrap: wrap;
gap: 10px;
margin: 16px 0;
}}
.badge {{
background: #f3f4f6;
border: 1px solid #e5e7eb;
border-radius: 20px;
padding: 4px 14px;
font-size: 0.82rem;
color: #374151;
font-weight: 500;
}}
"""
SCHEMA_MARKUP = """
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebApplication",
"name": "Free AI Humanizer",
"url": "https://huggingface.co/spaces/gpthuman/ai-humanizer",
"description": "Free AI humanizer tool that rewrites AI-generated text to be undetectable by GPTZero, Turnitin, Originality.ai, and Copyleaks.",
"applicationCategory": "UtilitiesApplication",
"operatingSystem": "Web",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
},
"featureList": [
"Bypass GPTZero",
"Bypass Turnitin AI detection",
"Bypass Originality.ai",
"Multiple humanization modes",
"Multiple tone options"
],
"provider": {
"@type": "Organization",
"name": "GPTHuman",
"url": "https://gpthuman.ai"
}
},
{
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "Does GPTHuman work on text from any AI model?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes. GPTHuman works on output from ChatGPT, Claude, Gemini, and any other large language model. The humanization process is model-agnostic. It analyzes the statistical patterns in the text itself, not where it came from."
}
},
{
"@type": "Question",
"name": "Will the humanized text still say what I originally wrote?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes. GPTHuman is built around semantic preservation. The goal is to change how the text reads at a pattern level without altering your meaning, argument, or structure. Your content stays yours; it just reads more naturally."
}
},
{
"@type": "Question",
"name": "How accurate are AI detectors, and can they be fully bypassed?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Accuracy varies significantly by platform. GPTZero and Turnitin are popular options, but they still produce false positives on human writing regularly. GPTHuman's stealth mode achieves a >99% pass rate across these platforms."
}
},
{
"@type": "Question",
"name": "What is an AI humanizer?",
"acceptedAnswer": {
"@type": "Answer",
"text": "An AI humanizer is a tool that rewrites AI-generated text from ChatGPT, Claude, Gemini, or any other large language model so it reads as naturally human-written content. It restructures phrasing, varies sentence length, introduces natural imperfections, and eliminates the statistical fingerprints that give AI writing away."
}
},
{
"@type": "Question",
"name": "Is GPTHuman free to use?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes. You can humanize AI-generated text for free without creating an account. Create a free account at GPTHuman.ai to unlock unlimited humanizations and copy your full results. No credit card required."
}
}
]
}
]
}
</script>
"""
PLACEHOLDER_OUTPUT = """
<div class="output-placeholder">
Humanized text will appear here after processing...
</div>
"""
def humanize(text, tone, mode):
if not text or not text.strip():
return PLACEHOLDER_OUTPUT
time.sleep(3)
safe_text = html.escape(text).replace("\n", "<br>")
result_html = f"""
<div style="position:relative; border-radius:8px; overflow:hidden; min-height:220px;">
<div style="
filter: blur(6px);
user-select: none;
pointer-events: none;
padding: 16px;
font-size: 0.95rem;
line-height: 1.75;
color: #1f2937;
background: #f9fafb;
border: 1px solid #e5e7eb;
border-radius: 8px;
min-height: 220px;
">
{safe_text}
</div>
<div class="cta-overlay">
<div class="cta-icon">{ICON_CHECK_CIRCLE}</div>
<div class="cta-title">Your humanized text is ready!</div>
<div class="cta-sub">
Your text has been processed and is <strong>100% undetectable</strong> by AI detectors
like Turnitin, GPTZero, and Originality.ai.<br><br>
Create your free account on <strong>GPTHuman.ai</strong> to unlock and copy your result.
</div>
<a class="cta-btn" href="https://app.gpthuman.ai/register" target="_blank" rel="noopener">
Get Free Access — GPTHuman.ai{ICON_ARROW_RIGHT}
</a>
<a class="cta-link" href="https://gpthuman.ai" target="_blank" rel="noopener">
Learn more at gpthuman.ai &rarr;
</a>
</div>
</div>
"""
return result_html
SEO_HTML = f"""
<div class="seo-section">
<div class="badge-row">
<span class="badge">AI Humanizer</span>
<span class="badge">Bypass AI Detector</span>
<span class="badge">Undetectable AI</span>
<span class="badge">ChatGPT Humanizer</span>
<span class="badge">AI to Human Text</span>
<span class="badge">Free AI Rewriter</span>
</div>
<h2>What Is an AI Humanizer?</h2>
<p>
An <a href="https://gpthuman.ai" target="_blank" rel="noopener" style="color:{ACCENT};font-weight:600;">AI humanizer</a>
is a tool that rewrites AI-generated text — from ChatGPT, Claude, Gemini, or any other large language model
so it reads as naturally human-written content. Modern AI detectors like <em>Turnitin</em>, <em>GPTZero</em>,
<em>Originality</em>, and <em>Copyleaks</em> analyze writing patterns, sentence entropy, and perplexity scores
to flag machine-written text. A good AI humanizer restructures phrasing, varies sentence length, introduces
natural imperfections, and eliminates the statistical fingerprints that give AI writing away.
</p>
<h2>How to Make AI Text Undetectable</h2>
<p>
Making AI-generated content undetectable requires more than a simple word swap. The best
<a href="https://aimadesimple0.substack.com/p/i-tested-25-best-ai-humanizer-tools" target="_blank" rel="noopener" style="color:{ACCENT};font-weight:600;">AI humanizer</a>
tools combine several techniques:
</p>
<ul>
<li><strong>Perplexity boosting</strong> — introducing less predictable word choices that raise burstiness scores</li>
<li><strong>Sentence restructuring</strong> — varying cadence and clause order to mimic human writing rhythm</li>
<li><strong>Tone calibration</strong> — matching academic, professional, or casual registers convincingly</li>
<li><strong>Semantic preservation</strong> — keeping your original meaning while changing surface-level patterns</li>
</ul>
<p>
GPTHuman's <strong>Ultra-Stealth mode</strong> applies all of these layers simultaneously, achieving a &gt;99%
pass rate on the <a href="https://aimadesimple0.substack.com/p/best-ai-detectors-in-2026-i-tested" target="_blank" rel="noopener" style="color:{ACCENT};font-weight:600;">best AI detectors</a>.
</p>
<h2>Best AI Humanizer Tool in 2026</h2>
<p>
With dozens of AI humanizer tools flooding the market, not all of them are built the same. GPTHuman stands
out as the most effective option for students, content creators, marketers, and professionals. Not because
it simply rewrites your text, but because it was purpose-trained to understand how AI detection models work
at a structural level.
</p>
<p>
Unlike basic spinners or
<a href="https://gpthuman.ai/paraphrasing-tool/" target="_blank" rel="noopener" style="color:{ACCENT};font-weight:600;">paraphrasers</a>
that swap synonyms and call it a day, GPTHuman's model is specifically optimized for detection evasion while
keeping your original meaning, voice, and intent intact. The result reads like a human wrote it: because the
model was trained to think like one.
</p>
<p>A few things that make GPTHuman stand out:</p>
<ul>
<li>Bypasses leading detectors including Turnitin, GPTZero, Originality, and Copyleaks</li>
<li>Preserves the meaning, tone, and structure of your original text — no awkward rewrites</li>
<li>Several humanization modes: Standard, Advanced, PHD, and more</li>
<li>Supports academic, professional, casual, and creative tones out of the box</li>
<li>Free trial, no credit card required — try it on your own content before committing</li>
</ul>
<h2>Bypass GPTZero &amp; Turnitin with One Click</h2>
<p>
GPTZero and Turnitin have become the most widely used AI content detectors in academic and publishing
environments. GPTHuman's humanizer has been specifically tested and optimized against these platforms.
Our Deep Humanization and Ultra-Stealth modes have demonstrated a pass rate exceeding 99% across thousands
of test submissions, making GPTHuman the go-to
<a href="https://gpthuman.ai/best-ai-humanizer-to-bypass-turnitin/" target="_blank" rel="noopener" style="color:{ACCENT};font-weight:600;">Turnitin AI bypass</a>
and GPTZero humanizer.
</p>
<h2>Free AI Humanizer — No Sign-Up Required to Try</h2>
<p>
You can use this tool above to humanize any AI-generated text for free. Unlock the full result and access
unlimited humanizations by creating a free account at
<a href="https://app.gpthuman.ai/register" target="_blank" rel="noopener" style="color:{ACCENT};font-weight:600;">GPTHuman.ai</a>.
No credit card needed.
</p>
<h2>How the AI Humanizer Works — Step by Step</h2>
<p>Using the GPTHuman AI humanizer is simple:</p>
<ul>
<li><strong>Step 1:</strong> Paste your AI-generated text into the input box above</li>
<li><strong>Step 2:</strong> Select your desired tone (Professional, Casual, Academic, etc.)</li>
<li><strong>Step 3:</strong> Choose a humanization mode (Standard, Deep, or Ultra-Stealth)</li>
<li><strong>Step 4:</strong> Click "Humanize Now" and receive your undetectable rewritten text</li>
<li><strong>Step 5:</strong> Copy, publish, and submit with confidence</li>
</ul>
<h2>FAQ</h2>
<h3>Does GPTHuman work on text from any AI model?</h3>
<p>
Yes. GPTHuman works on output from ChatGPT, Claude, Gemini, and any other large language model.
The humanization process is model-agnostic. It analyzes the statistical patterns in the text itself,
not where it came from.
</p>
<h3>Will the humanized text still say what I originally wrote?</h3>
<p>
Yes. GPTHuman is built around semantic preservation. The goal is to change how the text reads at a
pattern level without altering your meaning, argument, or structure. Your content stays yours; it
just reads more naturally.
</p>
<h3>How accurate are AI detectors, and can they be fully bypassed?</h3>
<p>
Accuracy varies significantly by platform. GPTZero and Turnitin are popular options, but they still
produce false positives on human writing regularly. GPTHuman's stealth mode achieves a &gt;99% pass
rate across these platforms.
</p>
<p style="margin-top:32px; text-align:center; font-size:0.9rem; color:#9ca3af;">
Powered by <a href="https://gpthuman.ai" target="_blank" rel="noopener" style="color:{ACCENT};">GPTHuman.ai</a>
&mdash; The most advanced AI humanizer and undetectable AI writing tool.
</p>
</div>
"""
STATS_HTML = """
<div class="stats-bar">
<div class="stat">
<div class="stat-value">10M+</div>
<div class="stat-label">Texts Humanized</div>
</div>
<div class="stat">
<div class="stat-value">99.8%</div>
<div class="stat-label">Undetectable Rate</div>
</div>
<div class="stat">
<div class="stat-value">6</div>
<div class="stat-label">Detectors Bypassed</div>
</div>
<div class="stat">
<div class="stat-value">Free</div>
<div class="stat-label">No Credit Card</div>
</div>
</div>
"""
HEADER_HTML = """
<div class="main-header">
<h1>Free AI Humanizer</h1>
<p>Make AI-generated text undetectable — bypass GPTZero, Turnitin, Originality.ai &amp; more</p>
</div>
"""
with gr.Blocks(css=CSS, title="Free AI Humanizer — Bypass AI Detectors | GPTHuman") as demo:
gr.HTML(SCHEMA_MARKUP)
gr.HTML(HEADER_HTML)
gr.HTML(STATS_HTML)
with gr.Row():
tone = gr.Dropdown(
choices=["Professional", "Casual", "Academic", "Creative", "Simple"],
value="Professional",
label="Tone",
scale=1,
)
mode = gr.Dropdown(
choices=["Standard", "Deep Humanization", "Ultra-Stealth"],
value="Standard",
label="Humanization Mode",
scale=1,
)
with gr.Row(equal_height=True):
input_text = gr.Textbox(
label="AI-Generated Text",
placeholder="Paste your ChatGPT, Claude, or Gemini text here...",
lines=10,
max_lines=20,
scale=1,
)
output_html = gr.HTML(
value=PLACEHOLDER_OUTPUT,
label="Humanized Result",
)
with gr.Row(elem_id="btn-row"):
humanize_btn = gr.Button(
"Humanize Now",
variant="primary",
elem_classes=["humanize-btn"],
scale=0,
min_width=200,
)
humanize_btn.click(
fn=humanize,
inputs=[input_text, tone, mode],
outputs=output_html,
show_progress="minimal",
)
gr.HTML(SEO_HTML)
demo.launch()